linux/include
Gregory Haskins 73fe6aae84 sched: add RT-balance cpu-weight
Some RT tasks (particularly kthreads) are bound to one specific CPU.
It is fairly common for two or more bound tasks to get queued up at the
same time.  Consider, for instance, softirq_timer and softirq_sched.  A
timer goes off in an ISR which schedules softirq_thread to run at RT50.
Then the timer handler determines that it's time to smp-rebalance the
system so it schedules softirq_sched to run.  So we are in a situation
where we have two RT50 tasks queued, and the system will go into
rt-overload condition to request other CPUs for help.

This causes two problems in the current code:

1) If a high-priority bound task and a low-priority unbounded task queue
   up behind the running task, we will fail to ever relocate the unbounded
   task because we terminate the search on the first unmovable task.

2) We spend precious futile cycles in the fast-path trying to pull
   overloaded tasks over.  It is therefore optimial to strive to avoid the
   overhead all together if we can cheaply detect the condition before
   overload even occurs.

This patch tries to achieve this optimization by utilizing the hamming
weight of the task->cpus_allowed mask.  A weight of 1 indicates that
the task cannot be migrated.  We will then utilize this information to
skip non-migratable tasks and to eliminate uncessary rebalance attempts.

We introduce a per-rq variable to count the number of migratable tasks
that are currently running.  We only go into overload if we have more
than one rt task, AND at least one of them is migratable.

In addition, we introduce a per-task variable to cache the cpus_allowed
weight, since the hamming calculation is probably relatively expensive.
We only update the cached value when the mask is updated which should be
relatively infrequent, especially compared to scheduling frequency
in the fast path.

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-01-25 21:08:07 +01:00
..
acpi kobject: convert /sys/firmware/acpi/ to use kobject_create 2008-01-24 20:40:23 -08:00
asm-alpha alpha: build fixes 2007-12-17 19:28:16 -08:00
asm-arm [ARM] pxa: silence warnings from cpu_is_xxx() macros 2008-01-10 12:33:54 +00:00
asm-avr32 [AVR32] NMI debugging 2008-01-25 08:31:43 +01:00
asm-blackfin Blackfin SPI driver: move hard coded pin_req to board file 2007-12-05 09:21:20 -08:00
asm-cris CRIS v10: vmlinux.lds.S: ix kernel oops on boot and use common defines 2008-01-17 15:38:58 -08:00
asm-frv
asm-generic Revert quicklist need->flush fix 2007-12-26 22:04:09 -08:00
asm-h8300 asm-h8300: parentheses around definition CLOCK_TICK_RATE 2007-12-10 19:43:54 -08:00
asm-ia64 [IA64] Update Altix BTE error return status patch 2008-01-03 13:18:58 -08:00
asm-m32r m32r: Update sys_rt_sigsuspend 2007-11-28 01:24:04 +09:00
asm-m68k
asm-m68knommu
asm-mips [MIPS] SMTC: Fix build error. 2008-01-22 00:35:23 +00:00
asm-parisc [PARISC] print more than one character at a time for pdc console 2007-12-06 09:32:15 -08:00
asm-powerpc [POWERPC] Fix boot failure on POWER6 2008-01-15 17:30:58 +11:00
asm-ppc
asm-s390 [S390] pud_present/pmd_present bug. 2007-12-17 16:25:56 +01:00
asm-sh sh: Force __access_ok() to obey address space limit. 2008-01-11 13:18:16 +09:00
asm-sh64
asm-sparc [SPARC32]: Silence sparc32 warnings on missing syscalls. 2007-12-14 10:59:50 -08:00
asm-sparc64 [SPARC64]: Implement pci_resource_to_user() 2007-12-26 19:33:46 -08:00
asm-um uml: update address space affected by pud_clear 2007-11-14 18:45:37 -08:00
asm-v850
asm-x86 x86: asm-x86/msr.h: pull in linux/types.h 2008-01-15 16:44:38 +01:00
asm-xtensa
crypto [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h 2008-01-11 08:16:59 +11:00
keys
linux sched: add RT-balance cpu-weight 2008-01-25 21:08:07 +01:00
math-emu
media V4L/DVB (6601): V4L: videobuf-core locking fixes and comments 2007-12-11 18:08:08 -02:00
mtd
net [SOCK]: Adds a rcu_dereference() in sk_filter 2008-01-08 23:41:28 -08:00
pcmcia [AVR32] pcmcia ioaddr_t should be 32 bits on AVR32 2007-11-15 13:47:19 +01:00
rdma Kobject: change drivers/infiniband to use kobject_init_and_add 2008-01-24 20:40:26 -08:00
rxrpc
scsi Revert "scsi: revert "[SCSI] Get rid of scsi_cmnd->done"" 2008-01-06 10:17:12 -08:00
sound [ALSA] version 1.0.15 2007-11-20 20:16:43 +01:00
video
xen
Kbuild