From bd3332707bb49a7e4d69ce375cb8d9988e543aad Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire Date: Wed, 20 Nov 2013 07:22:09 +0800 Subject: allow preemption in recursive migrate_disable call Minor cleanup in migrate_disable/migrate_enable. The recursive case does not need to disable preemption as it is "pinned" to the current cpu any way so it is safe to preempt it. Signed-off-by: Nicholas Mc Guire Signed-off-by: Sebastian Andrzej Siewior diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b38ae06..fdf5edd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2419,13 +2419,12 @@ void migrate_disable(void) WARN_ON_ONCE(p->migrate_disable_atomic); #endif - preempt_disable(); if (p->migrate_disable) { p->migrate_disable++; - preempt_enable(); return; } + preempt_disable(); pin_current_cpu(); p->migrate_disable = 1; preempt_enable(); @@ -2451,13 +2450,12 @@ void migrate_enable(void) #endif WARN_ON_ONCE(p->migrate_disable <= 0); - preempt_disable(); if (migrate_disable_count(p) > 1) { p->migrate_disable--; - preempt_enable(); return; } + preempt_disable(); if (unlikely(migrate_disabled_updated(p))) { /* * See comment in update_migrate_disable() about locking. -- cgit v0.10.2