]> err.no Git - linux-2.6/commit
[PATCH] sched: disable preempt in idle tasks
authorNick Piggin <nickpiggin@yahoo.com.au>
Wed, 9 Nov 2005 05:39:01 +0000 (21:39 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:56:33 +0000 (07:56 -0800)
commit5bfb5d690f36d316a5f3b4f7775fda996faa6b12
treeea53f15293d1ddb49c316eb65df85e939a4f6e5e
parentede3d0fba99520f268067917b50858d788bc41da
[PATCH] sched: disable preempt in idle tasks

Run idle threads with preempt disabled.

Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()).
How did it ever work before?

Might fix the CPU hotplugging hang which Nigel Cunningham noted.

We think the bug hits if the idle thread is preempted after checking
need_resched() and before going to sleep, then the CPU offlined.

After calling stop_machine_run, the CPU eventually returns from preemption and
into the idle thread and goes to sleep.  The CPU will continue executing
previous idle and have no chance to call play_dead.

By disabling preemption until we are ready to explicitly schedule, this bug is
fixed and the idle threads generally become more robust.

From: alexs <ashepard@u.washington.edu>

  PPC build fix

From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

  MIPS build fix

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
36 files changed:
arch/arm/kernel/process.c
arch/arm/kernel/smp.c
arch/arm26/kernel/process.c
arch/cris/arch-v32/kernel/smp.c
arch/cris/kernel/process.c
arch/frv/kernel/process.c
arch/h8300/kernel/process.c
arch/i386/kernel/process.c
arch/i386/kernel/smpboot.c
arch/ia64/kernel/process.c
arch/ia64/kernel/smpboot.c
arch/m32r/kernel/process.c
arch/m32r/kernel/smpboot.c
arch/m68k/kernel/process.c
arch/mips/kernel/process.c
arch/mips/kernel/smp.c
arch/parisc/kernel/process.c
arch/parisc/kernel/smp.c
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/pseries/setup.c
arch/ppc/kernel/idle.c
arch/ppc/kernel/smp.c
arch/ppc64/kernel/idle.c
arch/s390/kernel/process.c
arch/s390/kernel/smp.c
arch/sh/kernel/process.c
arch/sh/kernel/smp.c
arch/sh64/kernel/process.c
arch/sparc/kernel/process.c
arch/sparc64/kernel/process.c
arch/sparc64/kernel/smp.c
arch/v850/kernel/process.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/smpboot.c
arch/xtensa/kernel/process.c
init/main.c