Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2da272a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

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



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: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Cliff Wickman <cpw@sgi.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f7b4cddc
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -5457,14 +5457,14 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
		kthread_stop(rq->migration_thread);
		kthread_stop(rq->migration_thread);
		rq->migration_thread = NULL;
		rq->migration_thread = NULL;
		/* Idle task back to normal (off runqueue, low prio) */
		/* 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);
		update_rq_clock(rq);
		deactivate_task(rq, rq->idle, 0);
		deactivate_task(rq, rq->idle, 0);
		rq->idle->static_prio = MAX_PRIO;
		rq->idle->static_prio = MAX_PRIO;
		__setscheduler(rq, rq->idle, SCHED_NORMAL, 0);
		__setscheduler(rq, rq->idle, SCHED_NORMAL, 0);
		rq->idle->sched_class = &idle_sched_class;
		rq->idle->sched_class = &idle_sched_class;
		migrate_dead_tasks(cpu);
		migrate_dead_tasks(cpu);
		task_rq_unlock(rq, &flags);
		spin_unlock_irq(&rq->lock);
		migrate_nr_uninterruptible(rq);
		migrate_nr_uninterruptible(rq);
		BUG_ON(rq->nr_running != 0);
		BUG_ON(rq->nr_running != 0);