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 <der.herr@hofr.at>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This commit is contained in:
Nicholas Mc Guire 2013-11-20 07:22:09 +08:00 committed by Alibek Omarov
parent e644fa935a
commit 4ae42b6e7b
1 changed files with 2 additions and 4 deletions

View File

@ -2699,13 +2699,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();
@ -2731,13 +2730,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.