alistair23-linux/include
Oleg Nesterov 16882c1e96 sched: fix TASK_WAKEKILL vs SIGKILL race
schedule() has the special "TASK_INTERRUPTIBLE && signal_pending()" case,
this allows us to do

	current->state = TASK_INTERRUPTIBLE;
	schedule();

without fear to sleep with pending signal.

However, the code like

	current->state = TASK_KILLABLE;
	schedule();

is not right, schedule() doesn't take TASK_WAKEKILL into account. This means
that mutex_lock_killable(), wait_for_completion_killable(), down_killable(),
schedule_timeout_killable() can miss SIGKILL (and btw the second SIGKILL has
no effect).

Introduce the new helper, signal_pending_state(), and change schedule() to
use it. Hopefully it will have more users, that is why the task's state is
passed separately.

Note this "__TASK_STOPPED | __TASK_TRACED" check in signal_pending_state().
This is needed to preserve the current behaviour (ptrace_notify). I hope
this check will be removed soon, but this (afaics good) change needs the
separate discussion.

The fast path is "(state & (INTERRUPTIBLE | WAKEKILL)) + signal_pending(p)",
basically the same that schedule() does now. However, this patch of course
bloats schedule().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-06-10 11:37:25 +02:00
..
acpi
asm-alpha asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-arm [ARM] 5067/1: _raw_write_can_lock macro bugfix 2008-06-02 13:44:17 +01:00
asm-avr32
asm-blackfin Blackfin arch: update anomaly headers from toolchain trunk 2008-05-31 15:47:17 +08:00
asm-cris
asm-frv FRV: ip_fast_csum() requires a memory clobber on its inline asm 2008-06-05 10:31:21 -07:00
asm-generic gpio: build fixes 2008-05-24 09:56:13 -07:00
asm-h8300 asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-ia64 [IA64] Workaround for RSE issue 2008-05-27 13:24:39 -07:00
asm-m32r
asm-m68k m68k: Prefix ISA type with ISA_TYPE_ 2008-05-18 13:28:50 -07:00
asm-m68knommu
asm-mips [MIPS] Fix typo in header guard 2008-06-05 18:13:16 +01:00
asm-mn10300 MN10300: Fix typo in header guard 2008-05-28 07:59:06 -07:00
asm-parisc parisc: use conditional macro for 64-bit wide ops 2008-05-15 11:03:43 -04:00
asm-powerpc [POWERPC] Add "memory" clobber to MMIO accessors 2008-05-31 17:08:28 +10:00
asm-ppc
asm-s390 [S390] s390 types: make dma_addr_t 64 bit capable 2008-05-30 10:03:33 +02:00
asm-sh sh: fix miscompilation of ip_fast_csum with gcc >= 4.3 2008-06-02 12:40:14 +09:00
asm-sparc sparc: remove CVS keywords 2008-05-20 00:33:44 -07:00
asm-sparc64 sparc64: IO accessors fix 2008-05-30 02:01:28 -07:00
asm-um asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-v850 asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
asm-x86 x86: fix broken math-emu with lazy allocation of fpu area 2008-06-04 13:11:46 +02:00
asm-xtensa asm-{alpha,h8300,um,v850,xtensa}/param.h: unbreak HZ for userspace 2008-05-14 19:11:14 -07:00
crypto
keys
linux sched: fix TASK_WAKEKILL vs SIGKILL race 2008-06-10 11:37:25 +02:00
math-emu
media V4L/DVB (7911): Remove v4l2_video_std_fps prototype declaration 2008-06-05 06:35:42 -03:00
mtd
net sctp: Fix ECN markings for IPv6 2008-06-04 12:40:15 -07:00
pcmcia
rdma
rxrpc
scsi
sound [ALSA] ac97 - Fix ASUS A9T laptop output 2008-05-30 16:20:42 +02:00
video
xen
Kbuild