summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/sched/core.c6
1 files changed, 2 insertions, 4 deletions
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.