lkml.org 
[lkml]   [2005]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] PF_DEAD: cleanup usage

* Oleg Nesterov <oleg@tv-sign.ru> wrote:

> schedule() checks PF_DEAD on every context switch, and sets ->state =
> EXIT_DEAD to ensure that exited task will be deactivated.
>
> I think it is better to set EXIT_DEAD in do_exit(), along with PF_DEAD
> flag.

nice idea - your patch looks good to me.

> It is safe to do without task_rq() locking, because concurrent
> try_to_wake_up() can't change task's ->state: the 'state' argument of
> try_to_wake_up() can't have EXIT_DEAD bit. And in case when
> try_to_wake_up() sees stale value of ->state == TASK_RUNNING it will
> do nothing.

we should really not be getting concurrent wakeups in this situation
anyway - and you are right that even if we got, it should have no effect
neither in the EXIT_DEAD nor in the TASK_RUNNING case.

Acked-by: Ingo Molnar <mingo@elte.hu>

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-11-25 06:14    [W:0.048 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site