Oleg Nesterov 29b8849216 [PATCH] set EXIT_DEAD state in do_exit(), not in schedule()
schedule() checks PF_DEAD on every context switch and sets ->state = EXIT_DEAD
to ensure that the exiting task will be deactivated.  Note that this EXIT_DEAD
is in fact a "random" value, we can use any bit except normal TASK_XXX values.

It is better to set this state in do_exit() along with PF_DEAD flag and remove
that check in schedule().

We are safe wrt concurrent try_to_wake_up() (for example ptrace, tkill), it
can not 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 a stale value of
->state == TASK_RUNNING it will do nothing.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-29 09:18:20 -07:00
..
2006-09-29 09:18:07 -07:00
2006-09-11 13:32:30 -04:00
2006-09-29 09:18:12 -07:00
2006-09-29 09:18:12 -07:00
2005-04-16 15:20:36 -07:00
2006-03-26 08:57:03 -08:00
2006-09-29 09:18:15 -07:00
2006-07-03 15:27:04 -07:00
2006-09-29 09:18:12 -07:00
2006-09-29 09:18:06 -07:00
2005-04-16 15:20:36 -07:00
2006-09-29 09:18:15 -07:00
2006-09-29 09:18:12 -07:00
2006-04-19 16:27:18 -07:00
2006-07-10 13:24:25 -07:00