From patchwork Mon May 29 21:02:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 100688 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp498131qge; Mon, 29 May 2017 14:19:17 -0700 (PDT) X-Received: by 10.99.121.141 with SMTP id u135mr21783573pgc.48.1496092756886; Mon, 29 May 2017 14:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496092756; cv=none; d=google.com; s=arc-20160816; b=wjqZ9lmsJwvdQj1GgWxMGAaor+Y9SieWY3En8GyWpLWIY9s7c6VDTsL9ZWpjH5CSiH ojqFItKBahhARgKYvHDlLv9fMnQLOAJWb5puuaGss04yCHyUVGDGf1PCimFFUlEJP86I KYdS8siUBydfmNyXScZlmaA6uydNkMReyus1TZLGVbYHEYJAk3c2FpCQTrM7AA61QqJM ja5io7COKWHmHT7mVSK++S2jfXW+UBPcbC7FdU1l0RMdh4AG/H3kYpPzVjXjHWfkn6Ue ad11PR1xQrYiM87OLGZyiij4iSIoXd/fvszuiak86x+CbfEIVkxsAO9/jlpzMK+Qq1Ox Yrhw== 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=dN8tJaj0FjUZ6dhIX0DByQz7wiXNzH8xJROrbprSk1QubiQR2oxSnVdg6wXM4RKEZY IZNuDnDBrafqbxIzVRUs36kg2gGXoaVGHDtkWKR4Kx6aSIHuXTUM3dkgqmYMpOnYfyj4 CN6G9fg6EujNPEMAACZ+THRqr8gobtvNwXBt1O3aJ0z/MFGCZhEW2c9mfVwicPgi7BlZ QmgB/ZsMUwjvKnnNti/49ru/5dSDbG3perZnIYZJpBWAR3glh20o58Yz+50s5OIdbrel AzRdlZWd425zBN7n7vDDgimyq+zcEVM2tl/776wuK8G95/OErgPr2PWuoufm1YwfTBfJ 8h2A== 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 x5si11465257pfx.75.2017.05.29.14.19.16; Mon, 29 May 2017 14:19:16 -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 S1751320AbdE2VSt (ORCPT + 25 others); Mon, 29 May 2017 17:18:49 -0400 Received: from alt22.smtp-out.videotron.ca ([70.80.0.73]:45961 "EHLO alt22.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdE2VSL (ORCPT ); Mon, 29 May 2017 17:18:11 -0400 Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id FRohdrh4wPTiyFRoid5K4T; Mon, 29 May 2017 17:03:09 -0400 X-Authority-Analysis: v=2.1 cv=L469O7n8 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=tJ8p9aeEuA8A: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 8FFEE2DA0587; Mon, 29 May 2017 17:03:07 -0400 (EDT) From: Nicolas Pitre To: Ingo Molnar , Peter Zijlstra Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/7] cpuset/sched: cpuset makes sense for SMP only Date: Mon, 29 May 2017 17:02:56 -0400 Message-Id: <20170529210302.26868-2-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170529210302.26868-1-nicolas.pitre@linaro.org> References: <20170529210302.26868-1-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfJJLPKh4+n8yo48Fucdud8Bhhln0igg/dhuQU5+Wf5jXKcG54f1odkLQnT/HGgY1D6sU+LXoVX+EkX2CAsj/YhhHNrQ4dZmQ2bymoZvydcIaNckS4bDG qHDW6rCu7GSGq3vZcUNXhMAQjgf+CG2D39CdDlAb/LzpUhiM0vo2EomK4+v+MTIUXoRSD1DCeJ1F1LmAYgFb7EmHssrj00J/CiT0bGn3bqRWiuXtOKf6Qkom 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