From patchwork Mon Jan 20 12:39:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 23381 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6A9DC2107B for ; Mon, 20 Jan 2014 12:40:45 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g12sf7610669oah.10 for ; Mon, 20 Jan 2014 04:40:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=PfMlWQey0FOh5hTb8uMhjCXIN0Xr6IO+fCtjVbHioBE=; b=IzSpVqqjIjB51oQQX4vlRJyBHhFwlCZxZeJwJfjIZi6399rEKgnlB1biTNKPEukkqS OHqXFSc2oGeBec/veIfWAPvnfZC6cJSnY6Cpt3vVW6LBwAmOAY3Gezyyfnd4BQdZh4C6 p3oP9jz1Bbzu0ERQmWYfUs9VAFe1wnXYHqKl8BfzZ6ofDJCM9ujbT/OZShklLMyKvXqw lj+eNQwEiSWZQuJbZYcbRMmf30ddKtfjPXIwRDhQaU4AqYM1wyXN93U+fINPnFoaTPj3 c+mjTt8QvHZL7RcvsEjfGw4xQyNZcfc4WzjWV7nqQkb6QMC0f3sA8nrll3OLvbOT7z5o sGtQ== X-Gm-Message-State: ALoCoQnjwwFmtLM10pZ15yaMMQ0jwZ2PCNdLfCgb5XAEXaoA6t3zswJLm8eSH6nXgNrq4rrk6ATA X-Received: by 10.42.240.19 with SMTP id ky19mr5723808icb.4.1390221644522; Mon, 20 Jan 2014 04:40:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.8 with SMTP id ho8ls615974qeb.76.gmail; Mon, 20 Jan 2014 04:40:44 -0800 (PST) X-Received: by 10.53.9.201 with SMTP id du9mr54004vdd.36.1390221644389; Mon, 20 Jan 2014 04:40:44 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id i1si295049vcl.81.2014.01.20.04.40.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 04:40:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so1633386veb.21 for ; Mon, 20 Jan 2014 04:40:44 -0800 (PST) X-Received: by 10.220.109.1 with SMTP id h1mr1494632vcp.20.1390221644284; Mon, 20 Jan 2014 04:40:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp55894vcz; Mon, 20 Jan 2014 04:40:43 -0800 (PST) X-Received: by 10.66.216.129 with SMTP id oq1mr18203100pac.75.1390221643311; Mon, 20 Jan 2014 04:40:43 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wm3si1335349pab.223.2014.01.20.04.40.42; Mon, 20 Jan 2014 04:40:42 -0800 (PST) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753458AbaATMkO (ORCPT + 26 others); Mon, 20 Jan 2014 07:40:14 -0500 Received: from service87.mimecast.com ([91.220.42.44]:51581 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbaATMkF (ORCPT ); Mon, 20 Jan 2014 07:40:05 -0500 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 20 Jan 2014 12:40:03 +0000 Received: from e103711-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 20 Jan 2014 12:40:02 +0000 From: dietmar.eggemann@arm.com To: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, morten.rasmussen@arm.com, chris.redpath@arm.com Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com Subject: [RFC v2 PATCH 02/11] sched: export cpu_smt_mask() and cpu_cpu_mask() Date: Mon, 20 Jan 2014 12:39:39 +0000 Message-Id: <1390221588-20473-3-git-send-email-dietmar.eggemann@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1390221588-20473-1-git-send-email-dietmar.eggemann@arm.com> References: <1390221588-20473-1-git-send-email-dietmar.eggemann@arm.com> X-OriginalArrivalTime: 20 Jan 2014 12:40:02.0441 (UTC) FILETIME=[BCF84790:01CF15DC] X-MC-Unique: 114012012400312601 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dietmar.eggemann@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Dietmar Eggemann Move cpu_smt_mask() and cpu_cpu_mask() from scheduler code into the include/linux/topology.h so that an arch can use them for specifying cpu masks for its topology info array. Signed-off-by: Dietmar Eggemann --- include/linux/topology.h | 12 ++++++++++++ kernel/sched/core.c | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/topology.h b/include/linux/topology.h index 12ae6ce997d6..0bfcead0ace7 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -295,4 +295,16 @@ static inline int cpu_to_mem(int cpu) #define topology_core_cpumask(cpu) cpumask_of(cpu) #endif +#ifdef CONFIG_SCHED_SMT +static inline const struct cpumask *cpu_smt_mask(int cpu) +{ + return topology_thread_cpumask(cpu); +} +#endif + +static inline const struct cpumask *cpu_cpu_mask(int cpu) +{ + return cpumask_of_node(cpu_to_node(cpu)); +} + #endif /* _LINUX_TOPOLOGY_H */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8b8a37697a7d..523bb43756d6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4988,11 +4988,6 @@ static int __init isolated_cpu_setup(char *str) __setup("isolcpus=", isolated_cpu_setup); -static const struct cpumask *cpu_cpu_mask(int cpu) -{ - return cpumask_of_node(cpu_to_node(cpu)); -} - struct sd_data { struct sched_domain **__percpu sd; struct sched_group **__percpu sg; @@ -5368,13 +5363,6 @@ static void claim_allocations(int cpu, struct sched_domain *sd) *per_cpu_ptr(sdd->sgp, cpu) = NULL; } -#ifdef CONFIG_SCHED_SMT -static const struct cpumask *cpu_smt_mask(int cpu) -{ - return topology_thread_cpumask(cpu); -} -#endif - /* * Topology list, bottom-up. */