public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Nicolas Pitre <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, nico@linaro.org,
	peterz@infradead.org, mingo@kernel.org, nicolas.pitre@linaro.org,
	hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org
Subject: [tip:sched/core] sched/cpuset: Only offer CONFIG_CPUSETS if SMP is enabled
Date: Fri, 23 Jun 2017 06:58:10 -0700	[thread overview]
Message-ID: <tip-e1d4eeec5aaa28d25f249c0195b0e1d9b9feb7bd@git.kernel.org> (raw)
In-Reply-To: <20170614171926.8345-2-nicolas.pitre@linaro.org>

Commit-ID:  e1d4eeec5aaa28d25f249c0195b0e1d9b9feb7bd
Gitweb:     http://git.kernel.org/tip/e1d4eeec5aaa28d25f249c0195b0e1d9b9feb7bd
Author:     Nicolas Pitre <nicolas.pitre@linaro.org>
AuthorDate: Wed, 14 Jun 2017 13:19:23 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 23 Jun 2017 10:46:44 +0200

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: Nicolas 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.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 init/Kconfig        | 1 +
 kernel/sched/core.c | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index 1d3475f..c359038 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1156,6 +1156,7 @@ config CGROUP_HUGETLB
 
 config CPUSETS
 	bool "Cpuset controller"
+	depends on SMP
 	help
 	  This option will let you create and manage CPUSETs which
 	  allow dynamically partitioning a system into sets of CPUs and
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 62166da..7faf4b3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5451,6 +5451,8 @@ void init_idle(struct task_struct *idle, int cpu)
 #endif
 }
 
+#ifdef CONFIG_SMP
+
 int cpuset_cpumask_can_shrink(const struct cpumask *cur,
 			      const struct cpumask *trial)
 {
@@ -5494,7 +5496,6 @@ int task_can_attach(struct task_struct *p,
 		goto out;
 	}
 
-#ifdef CONFIG_SMP
 	if (dl_task(p) && !cpumask_intersects(task_rq(p)->rd->span,
 					      cs_cpus_allowed)) {
 		unsigned int dest_cpu = cpumask_any_and(cpu_active_mask,
@@ -5524,13 +5525,11 @@ int task_can_attach(struct task_struct *p,
 		rcu_read_unlock_sched();
 
 	}
-#endif
+
 out:
 	return ret;
 }
 
-#ifdef CONFIG_SMP
-
 bool sched_smp_initialized __read_mostly;
 
 #ifdef CONFIG_NUMA_BALANCING

  reply	other threads:[~2017-06-23 14:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 17:19 [PATCH 0/4] some scheduler code movements and small cleanup Nicolas Pitre
2017-06-14 17:19 ` [PATCH 1/4] cpuset/sched: cpuset makes sense for SMP only Nicolas Pitre
2017-06-23 13:58   ` tip-bot for Nicolas Pitre [this message]
2017-06-14 17:19 ` [PATCH 2/4] sched/deadline: move dl related code out of sched/core.c Nicolas Pitre
2017-06-14 17:19 ` [PATCH 3/4] sched/rt: move rt " Nicolas Pitre
2017-06-21 13:23 ` [PATCH 0/4] some scheduler code movements and small cleanup Nicolas Pitre
2017-06-21 16:46   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e1d4eeec5aaa28d25f249c0195b0e1d9b9feb7bd@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nico@linaro.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox