提交 e1d4eeec 编写于 作者: N Nicolas Pitre 提交者: Ingo Molnar

sched/cpuset: Only offer CONFIG_CPUSETS if SMP is enabled

Make CONFIG_CPUSETS=y depend on SMP as this feature makes no sense
on UP. This allows for configuring out cpuset_cpumask_can_shrink()
and task_can_attach() entirely, which shrinks the kernel a bit.
Signed-off-by: NNicolas Pitre <nico@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170614171926.8345-2-nicolas.pitre@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 387bc8b5
...@@ -1156,6 +1156,7 @@ config CGROUP_HUGETLB ...@@ -1156,6 +1156,7 @@ config CGROUP_HUGETLB
config CPUSETS config CPUSETS
bool "Cpuset controller" bool "Cpuset controller"
depends on SMP
help help
This option will let you create and manage CPUSETs which This option will let you create and manage CPUSETs which
allow dynamically partitioning a system into sets of CPUs and allow dynamically partitioning a system into sets of CPUs and
......
...@@ -5451,6 +5451,8 @@ void init_idle(struct task_struct *idle, int cpu) ...@@ -5451,6 +5451,8 @@ void init_idle(struct task_struct *idle, int cpu)
#endif #endif
} }
#ifdef CONFIG_SMP
int cpuset_cpumask_can_shrink(const struct cpumask *cur, int cpuset_cpumask_can_shrink(const struct cpumask *cur,
const struct cpumask *trial) const struct cpumask *trial)
{ {
...@@ -5494,7 +5496,6 @@ int task_can_attach(struct task_struct *p, ...@@ -5494,7 +5496,6 @@ int task_can_attach(struct task_struct *p,
goto out; goto out;
} }
#ifdef CONFIG_SMP
if (dl_task(p) && !cpumask_intersects(task_rq(p)->rd->span, if (dl_task(p) && !cpumask_intersects(task_rq(p)->rd->span,
cs_cpus_allowed)) { cs_cpus_allowed)) {
unsigned int dest_cpu = cpumask_any_and(cpu_active_mask, unsigned int dest_cpu = cpumask_any_and(cpu_active_mask,
...@@ -5524,13 +5525,11 @@ int task_can_attach(struct task_struct *p, ...@@ -5524,13 +5525,11 @@ int task_can_attach(struct task_struct *p,
rcu_read_unlock_sched(); rcu_read_unlock_sched();
} }
#endif
out: out:
return ret; return ret;
} }
#ifdef CONFIG_SMP
bool sched_smp_initialized __read_mostly; bool sched_smp_initialized __read_mostly;
#ifdef CONFIG_NUMA_BALANCING #ifdef CONFIG_NUMA_BALANCING
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册