diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-09 23:30:01 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-09 23:30:01 -0700 |
| commit | ddea677b6730f9f72d94f87885e38cff6d329fab (patch) | |
| tree | ea430cec4e0c852524a9584fe41e5517ade05b3e /include/linux/sched.h | |
| parent | 4197ad870f2d0618da7ca2bea46ec632128c0920 (diff) | |
[PATCH] Move migrate_all_tasks to CPU_DEAD handling
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
migrate_all_tasks is currently run with rest of the machine stopped.
It iterates thr' the complete task table, turning off cpu affinity of any task
that it finds affine to the dying cpu. Depending on the task table
size this can take considerable time. All this time machine is stopped, doing
nothing.
Stopping the machine for such extended periods can be avoided if we do
task migration in CPU_DEAD notification and that's precisely what this patch
does.
The patch puts idle task to the _front_ of the dying CPU's runqueue at the
highest priority possible. This cause idle thread to run _immediately_ after
kstopmachine thread yields. Idle thread notices that its cpu is offline and
dies quickly. Task migration can then be done at leisure in CPU_DEAD
notification, when rest of the CPUs are running.
Some advantages with this approach are:
- More scalable. Predicatable amout of time that machine is stopped.
- No changes to hot path/core code. We are just exploiting scheduler
rules which runs the next high-priority task on the runqueue. Also
since I put idle task to the _front_ of the runqueue, there
are no races when a equally high priority task is woken up
and added to the runqueue. It gets in at the back of the runqueue,
_after_ idle task!
- cpu_is_offline check that is presenty required in try_to_wake_up,
idle_balance and rebalance_tick can be removed, thus speeding them
up a bit
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Rusty mentioned that the unlikely hints against cpu_is_offline is
redundant since the macro already has that hint. Patch below removes those
redundant hints I added.
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 66faf991b373..9d813de1e4b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -671,8 +671,7 @@ extern void sched_balance_exec(void); #define sched_balance_exec() {} #endif -/* Move tasks off this (offline) CPU onto another. */ -extern void migrate_all_tasks(void); +extern void sched_idle_next(void); extern void set_user_nice(task_t *p, long nice); extern int task_prio(task_t *p); extern int task_nice(task_t *p); |
