lkml.org 
[lkml]   [2004]   [Feb]   [19]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 19 Feb 2004 02:46:08 -0500 (EST)
FromIngo Molnar <>
SubjectRe: keventd_create_kthread
On Thu, 19 Feb 2004, Rusty Russell wrote:

> That's not enough: it can set that and then get preemted.  It really
> want to return when the task is off the runqueue.  The original
> wait_task_inactive() does an incredible complicated and AFAICT useless
> dance wrt not locking and disabling preempt explicitly.  Ingo, how's
> this replacement?  (And who wrote this code?)

this is old code that morphed many times. Its main use was for exit.c's
purpose and in heavy clone/exit workloads it made quite a difference
whether the 'polling' for task exit was done under the runqueue lock or
not - hence the complexity. Task freeing is poll-free in 2.6 so
wait_task_inactive() doesnt get nearly as heavy use.

The current wait_task_inactive() code seems to be OK on x86.
Context-switching cannot be preempted. The goal of wait_task_inactive() is
to wait for the task to unschedule on a CPU. If that's due to preempt then
it's due to preempt.

i'd strongly advise against using wait_task_inactive() in
keventd_create_kthread() - it's _polling_. We must not do any polling like
that in any modern interface. Why does keventd_create_kthread() need
wait_task_inactive()?

	Ingo
-
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 13:01    [W:0.389 / U:0.050 seconds]
©2003-2008 Jasper Spaans