From patchwork Mon Jan 20 12:39:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 23389 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 323952107B for ; Mon, 20 Jan 2014 12:42:49 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf27745417iej.0 for ; Mon, 20 Jan 2014 04:42:48 -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=CJ9AHAF/HE87OkHvXyhwSCjP1hFSlr/Oanv/ac09CnY=; b=Nkw/GTNxG+vMxxY7FiJg4OwGAloI3vJTw6VDpkepPOObo+hevdJcXY9bx7gRZPvBjC GbJ/nids7urYwG9UqY8IAQwGVrh85p/OI3b5f+s2XoVWbq3q0nzhomBHygBGQyUOwaDq JxBIiMdFlXHZajv/iYtsRlo/o6ara1XT947kRLzJiVuCLFMXhXtLexHi/rNW5Jhi4izE yygjaED8+Z4jcNoRBNK7Cjjhw7ZJ0Q0m9ID/j23bnPlzdYJNP4uzp5FNs10y4I0s7gQz nnHBwWy+wo+Da2a9mKMbor5nj+eeVwEDQdeervohDBWjwtK9Cb7cyNPEZVYOoG3c6Zpr /CsA== X-Gm-Message-State: ALoCoQnxZXWXKeYgShRIXZJ2wYb+8dq94AtIsJ+iE5+IdesHc+cES5Zb4/wc6UQ+ybpWuv/Kt+Kq X-Received: by 10.182.204.105 with SMTP id kx9mr6698424obc.34.1390221768426; Mon, 20 Jan 2014 04:42:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.161 with SMTP id o30ls1021185qge.98.gmail; Mon, 20 Jan 2014 04:42:48 -0800 (PST) X-Received: by 10.220.193.70 with SMTP id dt6mr10480043vcb.17.1390221768262; Mon, 20 Jan 2014 04:42:48 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id vq3si289809veb.141.2014.01.20.04.42.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jan 2014 04:42:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id x14so2734740vbb.36 for ; Mon, 20 Jan 2014 04:42:48 -0800 (PST) X-Received: by 10.52.30.230 with SMTP id v6mr3596850vdh.6.1390221768167; Mon, 20 Jan 2014 04:42:48 -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 u4csp55966vcz; Mon, 20 Jan 2014 04:42:47 -0800 (PST) X-Received: by 10.68.251.133 with SMTP id zk5mr18452428pbc.69.1390221767483; Mon, 20 Jan 2014 04:42:47 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gm1si1377510pac.100.2014.01.20.04.42.46; Mon, 20 Jan 2014 04:42:46 -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 S1753940AbaATMmm (ORCPT + 26 others); Mon, 20 Jan 2014 07:42:42 -0500 Received: from service87.mimecast.com ([91.220.42.44]:51659 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752417AbaATMkG (ORCPT ); Mon, 20 Jan 2014 07:40:06 -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:04 +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:03 +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 05/11] sched: add a name to sched_domain_topology_info Date: Mon, 20 Jan 2014 12:39:42 +0000 Message-Id: <1390221588-20473-6-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:03.0816 (UTC) FILETIME=[BDCA1680:01CF15DC] X-MC-Unique: 114012012400408501 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.212.49 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 With this patch, an arbitrary name for a sd level has to be specified in the topology info table. This feature is still only active if CONFIG_SCHED_DEBUG is set. Signed-off-by: Dietmar Eggemann --- include/linux/sched.h | 11 ++++++++++- kernel/sched/core.c | 23 +++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index bf2ee608af67..f79a0d5041fb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2784,9 +2784,18 @@ typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); struct sched_domain_topology_info { sched_domain_mask_f mask; - int flags; + int flags; +#ifdef CONFIG_SCHED_DEBUG + char *name; +#endif }; +#ifdef CONFIG_SCHED_DEBUG +# define SD_NAME(n) .name = #n +#else +# define SD_NAME(n) +#endif + extern void set_sd_topology_info(struct sched_domain_topology_info *ti, unsigned int s); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 90aa7c3d3a00..798a4d2c9d7b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5243,12 +5243,6 @@ int __weak arch_sd_sibling_asym_packing(void) * Non-inlined to reduce accumulated stack pressure in build_sched_domains() */ -#ifdef CONFIG_SCHED_DEBUG -# define SD_INIT_NAME(sd, type) sd->name = #type -#else -# define SD_INIT_NAME(sd, type) do { } while (0) -#endif - static int default_relax_domain_level = -1; int sched_domain_level_max; @@ -5341,15 +5335,15 @@ static void claim_allocations(int cpu, struct sched_domain *sd) */ static struct sched_domain_topology_info default_topology_info[] = { #ifdef CONFIG_SCHED_SMT - { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES }, + { cpu_smt_mask, SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES, SD_NAME(SIBLING) }, #endif #ifdef CONFIG_SCHED_MC - { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES }, + { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES, SD_NAME(MC) }, #endif #ifdef CONFIG_SCHED_BOOK - { cpu_book_mask, }, + { cpu_book_mask, SD_NAME(BOOK) }, #endif - { cpu_cpu_mask, }, + { cpu_cpu_mask, SD_NAME(CPU) }, }; static struct sched_domain_topology_level *sched_domain_topology; @@ -5676,6 +5670,9 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) .last_balance = jiffies, .balance_interval = sd_weight, +#ifdef CONFIG_SCHED_DEBUG + .name = tl->info.name, +#endif }; /* @@ -5693,13 +5690,9 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) * setup. */ sd->flags |= arch_sd_sibling_asym_packing(); - - SD_INIT_NAME(sd, SMT); } else if (sd->flags & SD_SHARE_PKG_RESOURCES) { sd->cache_nice_tries = 1; sd->busy_idx = 2; - - SD_INIT_NAME(sd, MC); #ifdef CONFIG_NUMA } else if (sd->flags & SD_NUMA) { sd->busy_factor = 32, @@ -5719,8 +5712,6 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) sd->busy_idx = 2; sd->idle_idx = 1; sd->flags |= SD_PREFER_SIBLING; - - SD_INIT_NAME(sd, CPU); } sd->private = &tl->data;