linux/kernel
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
..
irq [PATCH] irq: remove a extra line 2006-09-29 09:18:07 -07:00
power Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 2006-09-26 11:49:46 -07:00
time
.gitignore
acct.c
audit.c [PATCH] selinux: rename selinux_ctxid_to_string 2006-09-26 08:48:52 -07:00
audit.h [PATCH] audit: AUDIT_PERM support 2006-09-11 13:32:30 -04:00
auditfilter.c [PATCH] selinux: rename selinux_ctxid_to_string 2006-09-26 08:48:52 -07:00
auditsc.c [PATCH] selinux: rename selinux_ctxid_to_string 2006-09-26 08:48:52 -07:00
capability.c [PATCH] pidspace: is_init() 2006-09-29 09:18:12 -07:00
compat.c [PATCH] posix-timers: Fix clock_nanosleep() doesn't return the remaining time in compatibility mode 2006-09-29 09:18:15 -07:00
configs.c
cpu.c [PATCH] Disable CPU hotplug during suspend 2006-09-26 08:48:59 -07:00
cpuset.c [PATCH] pidspace: is_init() 2006-09-29 09:18:12 -07:00
delayacct.c
dma.c
exec_domain.c
exit.c [PATCH] set EXIT_DEAD state in do_exit(), not in schedule() 2006-09-29 09:18:20 -07:00
extable.c
fork.c [PATCH] copy_process: cosmetic ->ioprio tweak 2006-09-29 09:18:18 -07:00
futex_compat.c
futex.c [PATCH] sys_get_robust_list(): don't take tasklist_lock 2006-09-29 09:18:18 -07:00
hrtimer.c [PATCH] posix-timers: Fix clock_nanosleep() doesn't return the remaining time in compatibility mode 2006-09-29 09:18:15 -07:00
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c [PATCH] kexec warning fix 2006-09-29 09:18:15 -07:00
kfifo.c [PATCH] memory ordering in __kfifo primitives 2006-09-29 09:18:13 -07:00
kmod.c [PATCH] Fix ____call_usermodehelper errors being silently ignored 2006-09-29 09:18:16 -07:00
kprobes.c
ksysfs.c
kthread.c
lockdep_internals.h [PATCH] lockdep: double the number of stack-trace entries 2006-09-13 07:32:14 -07:00
lockdep_proc.c
lockdep.c [PATCH] lockdep: print kernel version 2006-09-29 09:18:13 -07:00
Makefile
module.c [PATCH] load_module: no BUG if module_subsys uninitialized 2006-09-25 17:38:36 -07:00
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
panic.c [PATCH] Add the __stack_chk_fail() function 2006-09-26 10:52:39 +02:00
params.c [PATCH] module_subsys: initialize earlier 2006-09-29 09:18:08 -07:00
pid.c [PATCH] pid: remove temporary debug code in attach_pid 2006-09-27 08:26:19 -07:00
posix-cpu-timers.c [PATCH] posix-timers: Fix the flags handling in posix_cpu_nsleep() 2006-09-29 09:18:15 -07:00
posix-timers.c [PATCH] posix-timers: Fix clock_nanosleep() doesn't return the remaining time in compatibility mode 2006-09-29 09:18:15 -07:00
printk.c [PATCH] PM: make it possible to disable console suspending 2006-09-26 08:49:03 -07:00
profile.c [PATCH] Profiling: require buffer allocation on the correct node 2006-09-26 08:48:50 -07:00
ptrace.c [PATCH] pidspace: is_init() 2006-09-29 09:18:12 -07:00
rcupdate.c [PATCH] rcu_do_batch: make ->qlen decrement irq safe 2006-09-13 07:32:14 -07:00
rcutorture.c [PATCH] rcu: add lock annotations to rcu{,_bh}_torture_read_{lock,unlock} 2006-09-29 09:18:08 -07:00
relay.c [PATCH] kernel-doc for relay interface 2006-09-29 09:18:06 -07:00
resource.c Resources: insert identical resources above existing resources 2006-09-26 17:43:52 -07:00
rtmutex_common.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c [PATCH] clean up and remove some extra spinlocks from rtmutex 2006-09-29 09:18:09 -07:00
rtmutex.h
rwsem.c
sched.c [PATCH] set EXIT_DEAD state in do_exit(), not in schedule() 2006-09-29 09:18:20 -07:00
seccomp.c
signal.c [PATCH] __dequeue_signal() cleanup 2006-09-29 09:18:15 -07:00
softirq.c [PATCH] check return value of cpu_callback 2006-09-29 09:18:14 -07:00
softlockup.c [PATCH] check return value of cpu_callback 2006-09-29 09:18:14 -07:00
spinlock.c [PATCH] remove generic__raw_read_trylock() 2006-09-29 09:18:03 -07:00
stacktrace.c
stop_machine.c
sys_ni.c
sys.c [PATCH] kill extraneous printk in kernel_restart() 2006-09-29 09:18:16 -07:00
sysctl.c [PATCH] pidspace: is_init() 2006-09-29 09:18:12 -07:00
taskstats.c [NETLINK]: Extend netlink messaging interface 2006-09-22 14:53:43 -07:00
time.c
timer.c [PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem) 2006-09-29 09:18:15 -07:00
uid16.c
unwind.c [PATCH] unwind: fix unused variable warning when !CONFIG_MODULES 2006-09-29 09:18:11 -07:00
user.c
wait.c
workqueue.c