summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2013-11-19 23:22:09 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:18 (GMT)
commitb0b6961127cbf0d3274c0ae6af9e7aca37edad09 (patch)
tree3b2e631c162fc6deb9de4bd8d9abfb5cc9e42b21
parente4eb928c23d37b9ab872b811b13bda89741548c6 (diff)
downloadlinux-fsl-qoriq-b0b6961127cbf0d3274c0ae6af9e7aca37edad09.tar.xz
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>
-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.