From patchwork Wed Mar 19 16:22:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26597 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9712E203C3 for ; Wed, 19 Mar 2014 16:25:34 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf48240056ykp.1 for ; Wed, 19 Mar 2014 09:25:34 -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=OcAbfkbQ+d+tcOWDZGIanDBJrMEgsaXzl1FT8WVj+PXDvGzPo3ESkIcMAQHF2bnXxe cqln5ZVxVPmUhKLRhBHzTDAvI08XLrrP6TRscTqFFfh+02VBCUtXhq2cZUUCR+xUYaTR MAT5ELIr6h08tWIGFAq2XeZZrxm8EfFG+FM3gY0T41adwqrcOGXjCsNv98UlJ1ia7DKx UM+3GnmXgonduQURsBLJ8qPA4H2bnMBtldZT6P4Nxdun6wr9jGthauwysJz42wnSctAz OhSwTg2sJoxP0zAgiEPLkplrue37sXa1sjnEa5hpCHdouttxE72+LhMDyx425P3N/Ijf s3bQ== X-Gm-Message-State: ALoCoQnA931kxe8jJqFkcaD5FB9/g+N9+EBYxyJvQUgCnCI3sUbIlrXzgpK2hfT7lGDesWfWLebj X-Received: by 10.58.136.35 with SMTP id px3mr5556585veb.31.1395246334261; Wed, 19 Mar 2014 09:25:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.233 with SMTP id p96ls2389418qgd.33.gmail; Wed, 19 Mar 2014 09:25:34 -0700 (PDT) X-Received: by 10.220.192.71 with SMTP id dp7mr57647vcb.45.1395246334087; Wed, 19 Mar 2014 09:25:34 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id dd4si7861782vcb.145.2014.03.19.09.25.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:25:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so9442288vcb.14 for ; Wed, 19 Mar 2014 09:25:34 -0700 (PDT) X-Received: by 10.220.146.13 with SMTP id f13mr45706vcv.57.1395246334004; Wed, 19 Mar 2014 09:25:34 -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 i9csp314516vck; Wed, 19 Mar 2014 09:25:33 -0700 (PDT) X-Received: by 10.66.232.40 with SMTP id tl8mr18561170pac.137.1395246333053; Wed, 19 Mar 2014 09:25:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gr2si15344432pac.242.2014.03.19.09.25.31; Wed, 19 Mar 2014 09:25:31 -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 S934068AbaCSQYP (ORCPT + 26 others); Wed, 19 Mar 2014 12:24:15 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:39434 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934000AbaCSQYK (ORCPT ); Wed, 19 Mar 2014 12:24:10 -0400 Received: by mail-wi0-f181.google.com with SMTP id hm4so5275160wib.2 for ; Wed, 19 Mar 2014 09:24:09 -0700 (PDT) X-Received: by 10.194.78.77 with SMTP id z13mr3112442wjw.64.1395246249498; Wed, 19 Mar 2014 09:24:09 -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 j8sm57174788wjn.13.2014.03.19.09.24.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:24:08 -0700 (PDT) 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: [PATCH v3 2/6] sched: s390: create a dedicated topology table Date: Wed, 19 Mar 2014 17:22:41 +0100 Message-Id: <1395246165-31150-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395246165-31150-1-git-send-email-vincent.guittot@linaro.org> References: <1395246165-31150-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.220.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, }, };