From patchwork Thu Jan 23 10:49:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 23611 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C3AB218BD for ; Thu, 23 Jan 2014 10:49:52 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf6485747oag.0 for ; Thu, 23 Jan 2014 02:49:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to: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=VDpEXcHkgpPONE536d/C0LY+g9Ov8hZghJJred7+fXI=; b=N9bPTj9nmifLLX2TitSnD1XHWyEwFSM0mT3fsTKoVFhztpoy/AxODySm98OmT8i1Dp i+L91nejVdtSjFtzsIvMKDMNftJRqU1ebdBPp1QmlFFWKBrkPelZq04OENj7GnzxMO/6 hSFpcc77IKEOvH2CLfoEdI895nAmE1L5FOrFGSb3fdC8ADmgwirAQiHppqwrbs95LP7t BPcT9aXLFcWmpQBuuAzr7Ez+A1uz8uMGr3+kl7j3MHCv5p9SUQbdZUSmk8mVpoOkGEnD 0Yn4+tdgEed7FGF8w2Xt1qOVuWIA7H32wmvrxd0/EmlMc5bIGYUjLW0/SNJ9xN6y+pfn mOYA== X-Gm-Message-State: ALoCoQmnaUh++iuBkZJ6yaJbWBeBBdq3Kn0nIXuKmndmdRjBofGGi+jUB22NjXvBD65/g/Yp/61V X-Received: by 10.42.64.74 with SMTP id f10mr2399850ici.12.1390474191640; Thu, 23 Jan 2014 02:49:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.149 with SMTP id c21ls308034qgd.52.gmail; Thu, 23 Jan 2014 02:49:51 -0800 (PST) X-Received: by 10.58.180.227 with SMTP id dr3mr1226343vec.36.1390474191514; Thu, 23 Jan 2014 02:49:51 -0800 (PST) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id b20si6451922veu.22.2014.01.23.02.49.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:49:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id jz11so982488veb.36 for ; Thu, 23 Jan 2014 02:49:51 -0800 (PST) X-Received: by 10.58.172.132 with SMTP id bc4mr71491vec.45.1390474191429; Thu, 23 Jan 2014 02:49:51 -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 u4csp16913vcz; Thu, 23 Jan 2014 02:49:50 -0800 (PST) X-Received: by 10.68.224.195 with SMTP id re3mr7314958pbc.93.1390474190475; Thu, 23 Jan 2014 02:49:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sj5si13683459pab.23.2014.01.23.02.49.49; Thu, 23 Jan 2014 02:49:49 -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 S1753805AbaAWKtn (ORCPT + 27 others); Thu, 23 Jan 2014 05:49:43 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:41116 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753660AbaAWKtl (ORCPT ); Thu, 23 Jan 2014 05:49:41 -0500 Received: by mail-pb0-f41.google.com with SMTP id up15so1688323pbc.14 for ; Thu, 23 Jan 2014 02:49:40 -0800 (PST) X-Received: by 10.68.108.130 with SMTP id hk2mr7522365pbb.16.1390474180667; Thu, 23 Jan 2014 02:49:40 -0800 (PST) Received: from [10.0.0.100] ([162.243.130.63]) by mx.google.com with ESMTPSA id xu8sm60327397pab.0.2014.01.23.02.49.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:49:39 -0800 (PST) Message-ID: <52E0F3BF.5020904@linaro.org> Date: Thu, 23 Jan 2014 18:49:35 +0800 From: Alex Shi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Peter Zijlstra CC: Jason Low , Ingo Molnar , morten.rasmussen@arm.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, Mike Galbraith , wangyun@linux.vnet.ibm.com, Linux Kernel Mailing List Subject: Re: [PATCH 2/2] sched: add statistic for rq->max_idle_balance_cost References: <1390282399-17091-1-git-send-email-alex.shi@linaro.org> <1390282399-17091-2-git-send-email-alex.shi@linaro.org> <52DF802D.4030608@linaro.org> <20140122160901.GW13532@twins.programming.kicks-ass.net> <1390414208.2866.11.camel@j-VirtualBox> <52E0BB75.2080102@linaro.org> <20140123095443.GQ30183@twins.programming.kicks-ass.net> In-Reply-To: <20140123095443.GQ30183@twins.programming.kicks-ass.net> 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: alex.shi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 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: , On 01/23/2014 05:54 PM, Peter Zijlstra wrote: > On Thu, Jan 23, 2014 at 02:49:25PM +0800, Alex Shi wrote: >> On 01/23/2014 02:10 AM, Jason Low wrote: >>>>>>> P64(avg_idle); >>>>>>> + P64(max_idle_balance_cost); >>>>>>> #endif >>>>>>> P(ttwu_count); >>>>> >>>>> Not also the per-sd value in sd_alloc_ctl_domain_table() ? >>> Yeah, tracking the sd->max_newidle_lb_cost can also be useful. >>> >>> >> >> Thanks for suggestion! >> >> I thought the sd->max_newidle_lb_cost keep changing. But yes, it's >> still meaningful. >> BTW, in the pandaboard ES, sd balance cost is about 1~2ms. > > That's an insane amount of time for only 2 cpus. maybe, :( but it is the data. $ cat /proc/sys/kernel/sched_domain/cpu0/domain0/max_newidle_lb_cost 1873393 > >> --- >> [...] >> sd_alloc_ctl_domain_table(struct sched_domain *sd) >> { >> - struct ctl_table *table = sd_alloc_ctl_entry(8); >> + struct ctl_table *table = sd_alloc_ctl_entry(9); > > tip/master has 13 there, not 8. > Sorry about this. updated on tip/master. ----- >From c49ae4749ffa2d1f95bd0d8b3c8e6fbce8864f04 Mon Sep 17 00:00:00 2001 From: Alex Shi Date: Thu, 23 Jan 2014 18:39:54 +0800 Subject: [PATCH] sched: add statistic for newidle load balance cost Tracking rq->max_idle_balance_cost and sd->max_newidle_lb_cost. It's useful to know these values in debug mode. Signed-off-by: Alex Shi --- kernel/sched/core.c | 9 ++++++--- kernel/sched/debug.c | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 36c951b..4740456 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4815,7 +4815,7 @@ set_table_entry(struct ctl_table *entry, static struct ctl_table * sd_alloc_ctl_domain_table(struct sched_domain *sd) { - struct ctl_table *table = sd_alloc_ctl_entry(13); + struct ctl_table *table = sd_alloc_ctl_entry(14); if (table == NULL) return NULL; @@ -4843,9 +4843,12 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd) sizeof(int), 0644, proc_dointvec_minmax, false); set_table_entry(&table[10], "flags", &sd->flags, sizeof(int), 0644, proc_dointvec_minmax, false); - set_table_entry(&table[11], "name", sd->name, + set_table_entry(&table[11], "max_newidle_lb_cost", + &sd->max_newidle_lb_cost, + sizeof(long), 0644, proc_doulongvec_minmax, false); + set_table_entry(&table[12], "name", sd->name, CORENAME_MAX_SIZE, 0444, proc_dostring, false); - /* &table[12] is terminator */ + /* &table[13] is terminator */ return table; } diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index dd52e7f..7f17a38 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -321,6 +321,7 @@ do { \ P(sched_goidle); #ifdef CONFIG_SMP P64(avg_idle); + P64(max_idle_balance_cost); #endif P(ttwu_count);