From patchwork Fri Apr 11 09:44:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 28253 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9701020822 for ; Fri, 11 Apr 2014 09:47:55 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf15425756vcb.10 for ; Fri, 11 Apr 2014 02:47:55 -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=nc+s5B0aZ00zbRPKtVhE2/vYCsijBSRlb9pBsL4rbJs=; b=lzMvTHtJcyxdwKFb8nkaIVG5QaRETbx32s/PvfUnwanm+RPGVJMiVSI2VtSchESbdN 6rDd4qEim4qdY25GjaJI6WfnruA76Ltzs2kQSci6/ss9mOR8UTIRL7qIkfEmGiHaXPWA V2zz+hzbaTaDXw/9cBqbyB3Yzs/hmNBWXqWsYzNVJQLqXSoFNDsDdMYyxkrSMA66xQ75 MxFUQ31qnag64O/XqlKQZnWBmiBnjCCBPmAZ5vnRkv94mg3pDTACUVptBi4UoVIsCLUy 9sXdC4O5Oq3srM6thZsljKf0+99Ceo0tZXRhTtMSg1z4XCzNMGxLsN0gUgjgjmHK8bBn vUbg== X-Gm-Message-State: ALoCoQl9AWcwYZUEPmMYkFPc6iMONJY+QD9aS+uyXCs1pWVsE1dEWd02FOqE7P/ytLn3T0vhiVAq X-Received: by 10.236.25.175 with SMTP id z35mr9542144yhz.32.1397209675383; Fri, 11 Apr 2014 02:47:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.141 with SMTP id g13ls1491890qge.76.gmail; Fri, 11 Apr 2014 02:47:55 -0700 (PDT) X-Received: by 10.58.219.233 with SMTP id pr9mr19647002vec.10.1397209675261; Fri, 11 Apr 2014 02:47:55 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id dl6si1202946veb.127.2014.04.11.02.47.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:47:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id la4so4521390vcb.17 for ; Fri, 11 Apr 2014 02:47:55 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr5079479vdx.28.1397209675159; Fri, 11 Apr 2014 02:47:55 -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.221.72 with SMTP id ib8csp43040vcb; Fri, 11 Apr 2014 02:47:54 -0700 (PDT) X-Received: by 10.66.232.68 with SMTP id tm4mr25976374pac.114.1397209674350; Fri, 11 Apr 2014 02:47:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xk5si3849531pbc.443.2014.04.11.02.47.53; Fri, 11 Apr 2014 02:47:53 -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 S1756877AbaDKJro (ORCPT + 26 others); Fri, 11 Apr 2014 05:47:44 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:54867 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755530AbaDKJqJ (ORCPT ); Fri, 11 Apr 2014 05:46:09 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so699441wib.5 for ; Fri, 11 Apr 2014 02:46:08 -0700 (PDT) X-Received: by 10.194.109.6 with SMTP id ho6mr20218386wjb.21.1397209568709; Fri, 11 Apr 2014 02:46:08 -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 ct2sm10526013wjb.33.2014.04.11.02.46.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:46:07 -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, 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 v4 2/5] sched: s390: create a dedicated topology table Date: Fri, 11 Apr 2014 11:44:38 +0200 Message-Id: <1397209481-28542-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1397209481-28542-1-git-send-email-vincent.guittot@linaro.org> References: <1397209481-28542-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.172 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 0714574..b15b994 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6058,9 +6058,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, }, };