lkml.org 
[lkml]   [2004]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix deadlock in __create_workqueue
On Fri, Apr 30, 2004 at 07:19:01PM -0700, Andrew Morton wrote:
> Yes, the logic in worker_thread() is a bit dorky, but I
> don't believe that there is a race in there.

worker_thread examines kthread_should_stop() while its state
is TASK_RUNNING, after which it sets its state to TASK_INTERRUPTIBLE.
If kthread_stop were to come after kthread_should_stop and before
worker_thread has set its state to TASK_INTERRUPTIBLE (which is possible
because of a CPU going dead), wouldn't kthread_stop block forever?
Note that in case of CPU going dead, it is possible that a worker
thread bound to the dead cpu continues executing on a different cpu
before it is killed in CPU_DEAD processing.

Am I missing something here?

--


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.073 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site