From patchwork Wed Jun 14 17:19:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 105565 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp399641qgd; Wed, 14 Jun 2017 10:19:57 -0700 (PDT) X-Received: by 10.84.143.195 with SMTP id 61mr1242599plz.47.1497460797075; Wed, 14 Jun 2017 10:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497460797; cv=none; d=google.com; s=arc-20160816; b=jpWUT6OcqCohGBUfIN9lLz4jYDDODr5pSTRK2E/ljp1xMf0Lic3LETvufTldVj+zYH MNtv7vD1MhtBHMy5g7piKvJrSdCdH2XxYn98n37Kn1UfoM1LNxQWXJCKsa7i9VyFdfhi NkOCoamAQblft8lVpaMUgppGMXqB/+tFpNuBIrpXSSTPclb/KghQ1/a1uOFn75/mbFjZ t9sNpmh5sasQtmq6Q98dFDh1glrL4i8GcqMlXwgz+Cv4PCEJt+vHTZCicDVudCAqY/du tyDlezHeK/xJiG/7ZA+WuucBtQMMwNAAog/3XGjIYesjzgTS8wroEJXZF2y8pll+zLvc bkSw== 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=FIs/OI0mNMITY6mufm237pwcKiFICHqyCuO0wfNBy88=; b=06ZtCy5p+aXuPuiE4/mkHIi+7uJDEaPSkK79/NE3jOcgCDiOojTnssZANghejbsD5z gB2t4RaqYsrHPF79T2IZACcogoUakm+rkKutTbuh772fgcwWD1ftXvLOGF0vKRgl4LAn +DaZeEjUCSVnrLcv3jmOnjnWyS62eJ+nVc/LinIjVrvg3wKSgz23LSw+o+U5jyip0wyI UFFRCXIgpOpVJXrNoCCWH8bJWbQkWIQ7PXtkhDwQGp4VPABgtc/CcenabEiFZxZpfWSc yK6y+Hb2WK6IAbkg9lyJJcWO3Tz4cj4bKd9o6lHrkHBzGkr15NVoQ1143z5oR3Vk1iKv jZeg== 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 1si358488pgo.293.2017.06.14.10.19.56; Wed, 14 Jun 2017 10:19:57 -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 S1752539AbdFNRTi (ORCPT + 25 others); Wed, 14 Jun 2017 13:19:38 -0400 Received: from alt42.smtp-out.videotron.ca ([23.233.128.29]:64094 "EHLO alt42.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbdFNRTf (ORCPT ); Wed, 14 Jun 2017 13:19:35 -0400 Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id LBx7dfRkjcMN9LBx8dwxg2; Wed, 14 Jun 2017 13:19:34 -0400 X-Authority-Analysis: v=2.1 cv=YqOvP9sX 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 127D62DA05E0; Wed, 14 Jun 2017 13:19:33 -0400 (EDT) From: Nicolas Pitre To: Ingo Molnar , Peter Zijlstra Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/4] cpuset/sched: cpuset makes sense for SMP only Date: Wed, 14 Jun 2017 13:19:23 -0400 Message-Id: <20170614171926.8345-2-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614171926.8345-1-nicolas.pitre@linaro.org> References: <20170614171926.8345-1-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfF1aVjq4Yjwgr1invi++0IFvUvuD6XePXvjPMOYfT7cXbqBqVlWx3Oju3NCKYKCCkZ4+PRlq65cgxW8EDZO75i2RoYrvKAvRnp2WytUwLavC9DISEhy0 nZXdLaHTmXvK1MISreE4LebjXqvlSbyDE6OwhI4Q1Jm6YyDS+iiokHfCkAjUKzDXQhW54RR9Mz7CAWNnRttVuPZkhzgjUUtQTog9b0Mr23AqJAYazPuF63cR 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 2a2c9c4fb3..94fa712791 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