summaryrefslogtreecommitdiff
path: root/kernel/sched
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-08-11 13:14:58 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:37 (GMT)
commit9105ed27c65b20337dbfb193835c8538fb767179 (patch)
tree200682f8b9d1e63b3d92bb2b0bc08348931531d7 /kernel/sched
parent9587cb84db747d8cbe73bf8861e843778a5a462b (diff)
downloadlinux-fsl-qoriq-9105ed27c65b20337dbfb193835c8538fb767179.tar.xz
sched: Generic migrate_disable
Make migrate_disable() be a preempt_disable() for !rt kernels. This allows generic code to use it but still enforces that these code sections stay relatively small. A preemptible migrate_disable() accessible for general use would allow people growing arbitrary per-cpu crap instead of clean these things up. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-275i87sl8e1jcamtchmehonm@git.kernel.org
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 40523f9..caf9557 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4345,7 +4345,7 @@ void init_idle(struct task_struct *idle, int cpu)
#ifdef CONFIG_SMP
void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
{
- if (!p->migrate_disable) {
+ if (!__migrate_disabled(p)) {
if (p->sched_class && p->sched_class->set_cpus_allowed)
p->sched_class->set_cpus_allowed(p, new_mask);
p->nr_cpus_allowed = cpumask_weight(new_mask);
@@ -4396,7 +4396,7 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
do_set_cpus_allowed(p, new_mask);
/* Can the task run on the task's current CPU? If so, we're done */
- if (cpumask_test_cpu(task_cpu(p), new_mask) || p->migrate_disable)
+ if (cpumask_test_cpu(task_cpu(p), new_mask) || __migrate_disabled(p))
goto out;
dest_cpu = cpumask_any_and(cpu_active_mask, new_mask);
@@ -4415,6 +4415,7 @@ out:
}
EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr);
+#ifdef CONFIG_PREEMPT_RT_FULL
void migrate_disable(void)
{
struct task_struct *p = current;
@@ -4507,6 +4508,7 @@ void migrate_enable(void)
preempt_enable();
}
EXPORT_SYMBOL(migrate_enable);
+#endif /* CONFIG_PREEMPT_RT_FULL */
/*
* Move (not current) task off this cpu, onto dest cpu. We're doing