From patchwork Tue Mar 18 17:56:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26503 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A9149202FA for ; Tue, 18 Mar 2014 17:58:52 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id up15sf18833050pbc.6 for ; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) 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; bh=C+I8W16lzymZAHh8jVr9hub0KFEeG+inoKzE5zcNJZY=; b=jw4n5GRtb5bcQURup5I08wnPOa0wlg7/9RLdpnuVADtyPsVIxZ8EythHIjTGKb27g7 4r6Bux2DPRZluHu7DbVHLrNZAnvekInkVanmJUK/Rb82lpJu//YVxpphaBrQoj5QFKmS mgeYuWbYPHZ5pZp61JtIPkgIhfGOIcZNBIS3382BzdBqJaE5IG3eob0rMsLLR5/0VnSF lVujqDEeibWh9oLyZ7c1IdZVK4zl60tLl5DBdfJegK3vgO/f5D+qpjDMxjsrqsvdvhso MNVYSWg8kRyfLu3WVIWXG35C3B4+mjGruHu4yXllbu70YDZ24HHGUFUSwfb3VMCSDoYI 2olg== X-Gm-Message-State: ALoCoQnN7zysbdZYHm3Es1Tx96fEVkWBKYB7BHOC9pcTglhqlk+UXkWegYYDaqHHr6JeZjCczyvm X-Received: by 10.66.183.239 with SMTP id ep15mr12449310pac.7.1395165531906; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.85 with SMTP id a79ls2154757qge.72.gmail; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) X-Received: by 10.52.128.231 with SMTP id nr7mr1733402vdb.17.1395165531715; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id e10si6732821vcn.16.2014.03.18.10.58.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:58:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so7494318veb.14 for ; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) X-Received: by 10.58.133.15 with SMTP id oy15mr24907757veb.19.1395165531618; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) 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.78.9 with SMTP id i9csp232485vck; Tue, 18 Mar 2014 10:58:51 -0700 (PDT) X-Received: by 10.68.216.101 with SMTP id op5mr12077222pbc.148.1395165530697; Tue, 18 Mar 2014 10:58:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si11002780pbo.92.2014.03.18.10.58.05; Tue, 18 Mar 2014 10:58:05 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757432AbaCRR5o (ORCPT + 26 others); Tue, 18 Mar 2014 13:57:44 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:52882 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757381AbaCRR5i (ORCPT ); Tue, 18 Mar 2014 13:57:38 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so3973102wib.4 for ; Tue, 18 Mar 2014 10:57:37 -0700 (PDT) X-Received: by 10.194.1.242 with SMTP id 18mr25052225wjp.22.1395165457698; Tue, 18 Mar 2014 10:57:37 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id pm2sm43784795wic.0.2014.03.18.10.57.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:57:36 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, tony.luck@intel.com, fenghua.yu@intel.com, schwidefsky@de.ibm.com, james.hogan@imgtec.com, cmetcalf@tilera.com, benh@kernel.crashing.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Cc: linaro-kernel@lists.linaro.org, Vincent Guittot Subject: [PATCH v2 3/7] sched: s390: create a dedicated topology table Date: Tue, 18 Mar 2014 18:56:45 +0100 Message-Id: <1395165409-18055-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org> References: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org> 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: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 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: , BOOK level is only relevant for s390 so we create a dedicated topology table with BOOK level and remove it from default table. Signed-off-by: Vincent Guittot --- arch/s390/include/asm/topology.h | 11 +---------- arch/s390/kernel/topology.c | 20 ++++++++++++++++++++ kernel/sched/core.c | 3 --- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 07763bd..56af530 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h @@ -26,21 +26,12 @@ extern struct cpu_topology_s390 cpu_topology[NR_CPUS]; #define mc_capable() 1 -static inline const struct cpumask *cpu_coregroup_mask(int cpu) -{ - return &cpu_topology[cpu].core_mask; -} - -static inline const struct cpumask *cpu_book_mask(int cpu) -{ - return &cpu_topology[cpu].book_mask; -} - int topology_cpu_init(struct cpu *); int topology_set_cpu_management(int fc); void topology_schedule_update(void); void store_topology(struct sysinfo_15_1_x *info); void topology_expect_change(void); +const struct cpumask *cpu_coregroup_mask(int cpu); #else /* CONFIG_SCHED_BOOK */ diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 4b2e3e3..ceddd77 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -443,6 +443,23 @@ int topology_cpu_init(struct cpu *cpu) return sysfs_create_group(&cpu->dev.kobj, &topology_cpu_attr_group); } +const struct cpumask *cpu_coregroup_mask(int cpu) +{ + return &cpu_topology[cpu].core_mask; +} + +static const struct cpumask *cpu_book_mask(int cpu) +{ + return &cpu_topology[cpu].book_mask; +} + +static struct sched_domain_topology_level s390_topology[] = { + { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, + { cpu_book_mask, SD_INIT_NAME(BOOK) }, + { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { NULL, }, +}; + static int __init topology_init(void) { if (!MACHINE_HAS_TOPOLOGY) { @@ -452,6 +469,9 @@ static int __init topology_init(void) set_topology_timer(); out: update_cpu_masks(); + + set_sched_topology(s390_topology); + return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); } device_initcall(topology_init); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3397bcb..f2bfa76 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6061,9 +6061,6 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif -#ifdef CONFIG_SCHED_BOOK - { cpu_book_mask, SD_INIT_NAME(BOOK) }, -#endif { cpu_cpu_mask, SD_INIT_NAME(DIE) }, { NULL, }, };