From patchwork Wed Mar 5 07:18:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 25733 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F62720540 for ; Wed, 5 Mar 2014 07:19:13 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id lf12sf1432516vcb.9 for ; Tue, 04 Mar 2014 23:19:13 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=G30b57jRY7VPv93KVLl8CFerPyu1GLaFn6bym/ZFsqg=; b=E2yhUjyy8f+QY99NiHcwn+w+msfmVBpd1Nf0axWnlm0AAPyuFm07h1+YhTfYl5uhiW svYCeKOGFhPGBMaXxDkMd6Ln7eOgUUnvGMCEegSCNkjmAHB9eJm44LOa+Q+QKpznG7+i m7XndU7sthRmsWsHQEx09A/3bCJw9gSU5bPho3/ntDcbhsNBeQYV79CLy8wezKETHR0S bnFEvAcMTnIlBbGmsHXzunHvHRWiBdr/QpAnBB5a3ChROzHlXJhbuR/Va93WvGCpQSTZ NCVQTbeJtAqJ+0/VS396RhRqdB0m0O/LNR89w2l4w/YkLYa+obaq7hv2s050posIIqxb i7qA== X-Gm-Message-State: ALoCoQnr67C6MJBFE2Bjzj4k0deAgiBJebQXyUq8pk4qX+OfrDRJ+a8cBPjlQi4JYJwZMmP96gqb X-Received: by 10.58.112.1 with SMTP id im1mr1712167veb.33.1394003953781; Tue, 04 Mar 2014 23:19:13 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.146 with SMTP id 18ls191017qgx.6.gmail; Tue, 04 Mar 2014 23:19:13 -0800 (PST) X-Received: by 10.220.10.2 with SMTP id n2mr541927vcn.26.1394003953610; Tue, 04 Mar 2014 23:19:13 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id ks3si463566vec.13.2014.03.04.23.19.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:13 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id10so643441vcb.27 for ; Tue, 04 Mar 2014 23:19:13 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr3251012vcn.21.1394003953521; Tue, 04 Mar 2014 23:19:13 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.130.193 with SMTP id u1csp183745vcs; Tue, 4 Mar 2014 23:19:13 -0800 (PST) X-Received: by 10.66.240.130 with SMTP id wa2mr4839318pac.73.1394003952626; Tue, 04 Mar 2014 23:19:12 -0800 (PST) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id ra2si1404054pab.269.2014.03.04.23.19.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id w10so683078pde.24 for ; Tue, 04 Mar 2014 23:19:12 -0800 (PST) X-Received: by 10.66.20.10 with SMTP id j10mr4975255pae.11.1394003952197; Tue, 04 Mar 2014 23:19:12 -0800 (PST) Received: from lmenb30s.lme.st.com (z88l218.static.ctm.net. [202.175.88.218]) by mx.google.com with ESMTPSA id zc6sm9364621pab.18.2014.03.04.23.19.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:11 -0800 (PST) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, 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: dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org, Vincent Guittot Subject: [RFC 3/6] sched: s390: create a dedicated topology table Date: Wed, 5 Mar 2014 15:18:23 +0800 Message-Id: <1394003906-11630-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394003906-11630-1-git-send-email-vincent.guittot@linaro.org> References: <1394003906-11630-1-git-send-email-vincent.guittot@linaro.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.220.182 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 | 25 +++++++++++++++++++++++++ kernel/sched/core.c | 3 --- 3 files changed, 26 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..8a7ac47 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -443,6 +443,28 @@ 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, SD_SHARE_PKG_RESOURCES, SD_INIT_NAME(MC) }, + { cpu_book_mask, SD_INIT_NAME(BOOK) }, + { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { NULL, }, +}; + +static void __init set_sched_topology(void) +{ + sched_domain_topology = s390_topology; +} + static int __init topology_init(void) { if (!MACHINE_HAS_TOPOLOGY) { @@ -452,6 +474,9 @@ static int __init topology_init(void) set_topology_timer(); out: update_cpu_masks(); + + set_sched_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 6f6a8f0..3479467 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6043,9 +6043,6 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES, 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, }, };