linux-stable/include
Peter Zijlstra 0017d73509 sched: Fix TASK_WAKING vs fork deadlock
Oleg noticed a few races with the TASK_WAKING usage on fork.

 - since TASK_WAKING is basically a spinlock, it should be IRQ safe
 - since we set TASK_WAKING (*) without holding rq->lock it could
   be there still is a rq->lock holder, thereby not actually
   providing full serialization.

(*) in fact we clear PF_STARTING, which in effect enables TASK_WAKING.

Cure the second issue by not setting TASK_WAKING in sched_fork(), but
only temporarily in wake_up_new_task() while calling select_task_rq().

Cure the first by holding rq->lock around the select_task_rq() call,
this will disable IRQs, this however requires that we push down the
rq->lock release into select_task_rq_fair()'s cgroup stuff.

Because select_task_rq_fair() still needs to drop the rq->lock we
cannot fully get rid of TASK_WAKING.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 20:12:03 +02:00
..
acpi acpi: Support IBM SMBus CMI devices 2010-03-24 14:38:37 +01:00
asm-generic dma-mapping: pci: move pci_set_dma_mask and pci_set_consistent_dma_mask to pci-dma-compat.h 2010-03-12 15:52:42 -08:00
crypto
drm Merge branch 'radeon-for-airlied' of ../linux-2.6 into drm-linus 2010-03-15 11:08:59 +10:00
keys
linux sched: Fix TASK_WAKING vs fork deadlock 2010-04-02 20:12:03 +02:00
math-emu
media Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
mtd
net Bluetooth: Convert debug files to actually use debugfs instead of sysfs 2010-03-21 05:49:35 +01:00
pcmcia pcmcia: use dev_pm_ops for class pcmcia_socket_class 2010-03-24 11:00:11 +01:00
rdma
rxrpc
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-03-18 16:54:31 -07:00
sound Merge branch 'topic/misc' into for-linus 2010-03-08 09:35:50 +01:00
trace Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-03-18 16:52:46 -07:00
video broadsheetfb: support storing waveform 2010-03-12 15:52:34 -08:00
xen
Kbuild