From patchwork Tue Jun 6 23:24:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 103197 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1675471qgd; Tue, 6 Jun 2017 16:40:17 -0700 (PDT) X-Received: by 10.98.197.130 with SMTP id j124mr15739072pfg.239.1496792417215; Tue, 06 Jun 2017 16:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496792417; cv=none; d=google.com; s=arc-20160816; b=dsXItTegz/Us84JrRmLgMlwkk8C6poCAqQdHfgNXQZVp3MHYhBcU+A8MJ+Q4aF6hnx t/rsL9DLeVXHqcODnvcw+zMQIELBRUOw00XMmPzlnAilFAwO9t/6jSfzTH/E+PU2gBfw zmVdFfkc7rrFzzwCu8g9nOh/KbGRcZSX0FhZLZa4bbNB5fkviZnlCoIGpxUBjqUkvUXz Gklg3lN1/+Xf3SbYLsvWbSFE4Ckr5DXEfvsB0nwreJRGbfxNOh/SnW0RanZhZxOjcVCB 24oln4vIxZoyihKDUPx25tf812FozpFulSNCUMjXJvStWJ5Ru/FxOSS23VRvOz6nvwSt O1Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=D44kbRPAKpLhgtaSfY0B13THlDHWd33ngkR0TJJZUHs=; b=AiNAWGJaSHzUY8bjEjneK59Gw+jVgS7JDtZdAh4inGmVsuzD8a1dXMgdu/a1zi4RbG VXtY7jrc/GCbYnPdozUsT2gj5uOUQvB0eVXiGaV4QgFpvRjFoy45y2YWGcpp5eDy1a0U OWVJQI/wG2Ew/WErJVeHe/tJU58gpPHr+i/rXXvfgZxYTUYUKWxkFA+j5r3vW7i2pCnN a/3a8BBj6NZuw5ltAqt2xNl/W/zZAo//YMMBdfx10CkIpHWhvR576t8RoAz6l4pCHGOO jIX9jrapET5lKyXr7dwCjf+UdERbpBCuonsl1gkes1g1CQctH+iswL8RyYZ7YoACqdJh KAJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v61si11222426plb.501.2017.06.06.16.40.16; Tue, 06 Jun 2017 16:40:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751509AbdFFXkE (ORCPT + 25 others); Tue, 6 Jun 2017 19:40:04 -0400 Received: from alt32.smtp-out.videotron.ca ([24.53.0.21]:31629 "EHLO alt32.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766AbdFFXkB (ORCPT ); Tue, 6 Jun 2017 19:40:01 -0400 X-Greylist: delayed 900 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Jun 2017 19:40:01 EDT Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id INqMdbdIkWjC4INqOdAb1w; Tue, 06 Jun 2017 19:25:00 -0400 X-Authority-Analysis: v=2.1 cv=FfyXvMK6 c=1 sm=1 tr=0 a=keA3yYpnlypCNW5BNWqu+w==:117 a=keA3yYpnlypCNW5BNWqu+w==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=LWSFodeU3zMA:10 a=KKAkSRfTAAAA:8 a=YkCRfKK50VHpdthjoR0A:9 a=cvBusfyB2V15izCimMoJ:22 Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id D0B3D2DA0628; Tue, 6 Jun 2017 19:24:58 -0400 (EDT) From: Nicolas Pitre To: Ingo Molnar , Peter Zijlstra Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 1/8] cpuset/sched: cpuset makes sense for SMP only Date: Tue, 6 Jun 2017 19:24:43 -0400 Message-Id: <20170606232450.30278-2-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606232450.30278-1-nicolas.pitre@linaro.org> References: <20170606232450.30278-1-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfKSSH4cLyn0VC0ts8luKWkuN18XmpKKMwjBhFHqVJRp8Y//ZxFUdZ5YD6ORj+nnPf785POal7Xb+pj/PibGLfQIFnLeLU9OWpFc8BniZXyTg+kQVCgjU GiE98bljkFxZyl32MDXCptr4wCAjJhxdBBWCbeTMgqaxTQv30uny8wX/mWXd5Ka/6GHkHvw0LXmlQ7/MXrbWOg67NTkrk8/HeBvh7Aj/fvRZIfeiosmP/e+F Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make CONFIG_CPUSETS 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. Signed-off-by: Nicolas Pitre --- init/Kconfig | 1 + kernel/sched/core.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.9.4 diff --git a/init/Kconfig b/init/Kconfig index 4ef946b466..b9aed60cac 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 803c3bc274..de274b1bd2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5463,6 +5463,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) { @@ -5506,7 +5508,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, @@ -5536,13 +5537,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