linux/arch/ia64/kernel
Nick Piggin 64c7c8f885 [PATCH] sched: resched and cpu_idle rework
Make some changes to the NEED_RESCHED and POLLING_NRFLAG to reduce
confusion, and make their semantics rigid.  Improves efficiency of
resched_task and some cpu_idle routines.

* In resched_task:
- TIF_NEED_RESCHED is only cleared with the task's runqueue lock held,
  and as we hold it during resched_task, then there is no need for an
  atomic test and set there. The only other time this should be set is
  when the task's quantum expires, in the timer interrupt - this is
  protected against because the rq lock is irq-safe.

- If TIF_NEED_RESCHED is set, then we don't need to do anything. It
  won't get unset until the task get's schedule()d off.

- If we are running on the same CPU as the task we resched, then set
  TIF_NEED_RESCHED and no further action is required.

- If we are running on another CPU, and TIF_POLLING_NRFLAG is *not* set
  after TIF_NEED_RESCHED has been set, then we need to send an IPI.

Using these rules, we are able to remove the test and set operation in
resched_task, and make clear the previously vague semantics of
POLLING_NRFLAG.

* In idle routines:
- Enter cpu_idle with preempt disabled. When the need_resched() condition
  becomes true, explicitly call schedule(). This makes things a bit clearer
  (IMO), but haven't updated all architectures yet.

- Many do a test and clear of TIF_NEED_RESCHED for some reason. According
  to the resched_task rules, this isn't needed (and actually breaks the
  assumption that TIF_NEED_RESCHED is only cleared with the runqueue lock
  held). So remove that. Generally one less locked memory op when switching
  to the idle thread.

- Many idle routines clear TIF_POLLING_NRFLAG, and only set it in the inner
  most polling idle loops. The above resched_task semantics allow it to be
  set until before the last time need_resched() is checked before going into
  a halt requiring interrupt wakeup.

  Many idle routines simply never enter such a halt, and so POLLING_NRFLAG
  can be always left set, completely eliminating resched IPIs when rescheduling
  the idle task.

  POLLING_NRFLAG width can be increased, to reduce the chance of resched IPIs.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Con Kolivas <kernel@kolivas.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:33 -08:00
..
cpufreq [IA64] Add ACPI based P-state support 2005-08-26 15:09:24 -07:00
acpi-ext.c [ACPI] Lindent all ACPI files 2005-08-05 00:45:14 -04:00
acpi.c [IA64] move ACPI IOSAPIC locality domain mapping from pci.c to acpi.c 2005-09-19 15:57:48 -07:00
asm-offsets.c [IA64] fix circular dependency on generation of asm-offsets.h 2005-09-13 08:50:39 -07:00
brl_emu.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyclone.c [PATCH] fix missing includes 2005-10-30 17:37:32 -08:00
efi.c [IA64] include EFI memory information in /proc/iomem 2005-09-19 15:42:36 -07:00
efi_stub.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
entry.h [IA64] Drop spurious paren in entry.h 2005-06-20 09:34:02 -07:00
entry.S [IA64] Remove warnings for gcc 4.0 IA64 compilation. 2005-09-16 09:45:27 -07:00
fsys.S kbuild: ia64 use generic asm-offsets.h support 2005-09-09 22:03:13 +02:00
gate-data.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gate.lds.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gate.S kbuild: ia64 use generic asm-offsets.h support 2005-09-09 22:03:13 +02:00
head.S kbuild: ia64 use generic asm-offsets.h support 2005-09-09 22:03:13 +02:00
ia64_ksyms.c [IA64] __ia64_syscall() is no longer used anywhere in the kernel. Remove it. 2005-04-27 21:10:45 -07:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iosapic.c [IA64] Manual merge fix for 3 files 2005-09-08 14:27:13 -07:00
irq.c [IA64] wider use of for_each_cpu_mask() in arch/ia64 2005-10-25 15:10:08 -07:00
irq_ia64.c [IA64] assign_irq_vector() should not panic 2005-07-11 10:30:07 -07:00
irq_lsapic.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ivt.S [IA64] MCA/INIT: remove the physical mode path from minstate.h 2005-09-11 14:09:12 -07:00
jprobes.S [PATCH] Kprobes: prevent possible race conditions ia64 changes 2005-09-07 16:58:00 -07:00
kprobes.c [PATCH] Kprobes: preempt_disable/enable() simplification 2005-11-07 07:53:46 -08:00
machvec.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [PATCH] cpusets: Move the ia64 domain setup code to the generic code 2005-09-07 16:57:40 -07:00
mca.c [IA64] another place to use for_each_cpu_mask() in arch/ia64 2005-10-25 15:12:05 -07:00
mca_asm.S [IA64] Wire in the MCA/INIT handler stacks 2005-09-22 13:24:19 -07:00
mca_drv.c [IA64] MCA recovery verify pfn_valid 2005-09-22 13:27:59 -07:00
mca_drv.h [IA64] mca_drv cleanup 2005-09-16 10:39:40 -07:00
mca_drv_asm.S [IA64] mca_drv cleanup 2005-09-16 10:39:40 -07:00
minstate.h [IA64] MCA/INIT: remove the physical mode path from minstate.h 2005-09-11 14:09:12 -07:00
module.c [IA64] wider use of for_each_cpu_mask() in arch/ia64 2005-10-25 15:10:08 -07:00
numa.c [IA64] fix generic/up builds 2005-07-06 18:18:10 -07:00
pal.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
palinfo.c [IA64] Allow /proc/pal/cpu0/vm_info under the simulator 2005-08-31 08:34:51 -07:00
patch.c [IA64] Fix 2.6 kernel for the new ia64 assembler 2005-10-25 15:05:45 -07:00
perfmon.c [PATCH] kfree cleanup: arch 2005-11-07 07:54:06 -08:00
perfmon_default_smpl.c [IA64] perfmon: make pfm_sysctl a global, and other cleanup 2005-04-25 13:08:30 -07:00
perfmon_generic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_itanium.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_mckinley.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
process.c [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
ptrace.c [IA64] fix warning unused variable `g' 2005-10-28 15:52:13 -07:00
sal.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
salinfo.c [IA64] MCA/INIT: avoid reading INIT record during INIT event 2005-09-11 14:02:43 -07:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
setup.c [PATCH] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL 2005-11-07 07:53:23 -08:00
sigframe.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.c [PATCH] convert signal handling of NODEFER to act like other Unix boxes. 2005-08-29 10:03:11 -07:00
smp.c [IA64] wider use of for_each_cpu_mask() in arch/ia64 2005-10-25 15:10:08 -07:00
smpboot.c [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
sys_ia64.c [IA64] Rationalise Region Definitions 2005-08-24 15:35:41 -07:00
time.c [PATCH] jiffies_64 cleanup 2005-10-30 17:37:25 -08:00
topology.c [ACPI] delete CONFIG_ACPI_BOOT 2005-08-24 12:08:54 -04:00
traps.c [PATCH] Kprobes: prevent possible race conditions ia64 changes 2005-09-07 16:58:00 -07:00
unaligned.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
uncached.c [IA64] simplified efi memory map parsing 2005-09-08 12:39:59 -07:00
unwind.c [IA64] MCA/INIT: remove obsolete unwind code 2005-09-11 14:09:34 -07:00
unwind_decoder.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unwind_i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmlinux.lds.S [PATCH] Kprobes: prevent possible race conditions ia64 changes 2005-09-07 16:58:00 -07:00