projects/linux·commit d2da272a

migration_call(CPU_DEAD): use spin_lock_irq() instead of task_rq_lock()

d2da272a · Oleg Nesterov <[email protected]> · 2007-10-16 23:30:56 -07:00

Change migration_call(CPU_DEAD) to use direct spin_lock_irq() instead of
task_rq_lock(rq->idle), rq->idle can't change its task_rq().

This makes the code a bit more symmetrical with migrate_dead_tasks()'s path
which uses spin_lock_irq/spin_unlock_irq.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Cliff Wickman <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Srivatsa Vaddagiri <[email protected]>
Cc: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
d2da272a4e581e831e3567a37ef167686f1ea1d3
Parents
f7b4cddc

Changes

1 files changed · +2 −2

FileStatusAddDelContent
kernel/sched.cmodified+2−2View file

kernel/sched.c

View file
diff --git a/kernel/sched.c b/kernel/sched.c
index c747bc9..c4889ab 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5457,14 +5457,14 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
kthread_stop(rq->migration_thread);
rq->migration_thread = NULL;
/* Idle task back to normal (off runqueue, low prio) */
- rq = task_rq_lock(rq->idle, &flags);
+ spin_lock_irq(&rq->lock);
update_rq_clock(rq);
deactivate_task(rq, rq->idle, 0);
rq->idle->static_prio = MAX_PRIO;
__setscheduler(rq, rq->idle, SCHED_NORMAL, 0);
rq->idle->sched_class = &idle_sched_class;
migrate_dead_tasks(cpu);
- task_rq_unlock(rq, &flags);
+ spin_unlock_irq(&rq->lock);
migrate_nr_uninterruptible(rq);
BUG_ON(rq->nr_running != 0);