linux/arch/ia64
Dimitri Sivanich 71416bea5a [IA64] disable irq's and check need_resched before safe_halt
While sending interrupts to a cpu to repeatedly wake a thread, on occasion
that thread will take a full timer tick cycle (4002 usec in my case)
to wakeup.

The problem concerns a race condition in the code around the safe_halt()
call in the default_idle() routine.  Setting 'nohalt' on the kernel
command line causes the long wakeups to disappear.

void
default_idle (void)
{
        local_irq_enable();
        while (!need_resched()) {
-->             if (can_do_pal_halt)
-->                     safe_halt();
                else

A timer tick could arrive between the check for !need_resched and the
actual call to safe_halt() (which does a pal call to PAL_HALT_LIGHT).
By the time the timer tick completes, a thread that might now need to run
could get held up for as long as a timer tick waiting for the halted cpu.

I'm proposing that we disable irq's and check need_resched again before
calling safe_halt().  Does anyone see any problem with this approach?

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2007-08-13 10:17:23 -07:00
..
configs Pull ia64-clocksource into release branch 2007-07-20 11:26:47 -07:00
dig [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
hp Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2007-07-29 17:22:03 -07:00
ia32 [IA64] Remove a few duplicate includes 2007-07-30 16:28:59 -07:00
kernel [IA64] disable irq's and check need_resched before safe_halt 2007-08-13 10:17:23 -07:00
lib missing exports of csum_... 2007-07-17 11:01:07 -07:00
mm mm: fault feedback #2 2007-07-19 10:04:41 -07:00
oprofile Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pci [IA64] Nail two more simple section mismatch errors 2007-07-25 13:08:41 -07:00
scripts Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sn [IA64] SN2: Fix up sn2_rtc clock 2007-08-01 13:15:14 -07:00
Kconfig [IA64] Fix build failure in fs/quota.c 2007-07-27 15:40:13 -07:00
Kconfig.debug [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
Makefile [IA64] add vmlinuz target 2006-06-21 14:31:07 -07:00
defconfig Pull ia64-clocksource into release branch 2007-07-20 11:26:47 -07:00
install.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
module.lds Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00