Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1227411ybx; Tue, 5 Nov 2019 12:29:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxcPC4KzMUFdsRKyInbNjoxL7LCIWVj9r2yl2cQ2lVmEJQ0rr1qkkVJVpMfEOm5vkhBxf1g X-Received: by 2002:a17:906:c797:: with SMTP id cw23mr31210113ejb.19.1572985781360; Tue, 05 Nov 2019 12:29:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572985781; cv=none; d=google.com; s=arc-20160816; b=hfFUyf9A3M74tHcjzL09T7K3yVo+YBoXnm/Pc4xe6wXuz7FfZn4XwD0uRQ917jK2Mi AWjRu6HHUCwIGi+2GZyLmDICpQyb2UEBFe9k0tspxP2EV1Zq7oH3kE84EzxayUfg0MQ3 NHqTvLkernfwsAAsjMZju4vY0YNCA36kb80n+jzm00supkgta9O2NrkShROvJSLlHsw9 /Sb/2G5zutPrzpYtGn7aJY3lD6/d9654MSTQg+DFNF5QiIHyRw0D9U1BrwxH4EdyqEqk P1EsyWp5zb5kLKxydJZ3D95hsju89fGturiAoe7iwh2g9pP0UHBIV8cU2pI+R1oLShR5 o77A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=WK0wm7UHiRNiCdFdcI7k8HaWnL7BzBlfZNe4kmd9HH4=; b=ZxEuDLb0lgyFv3NztbkF5zU363EAkBoZGjYK7n4HzWup4HTCemkdlFoQGUa0Z+jX7J v/rifaBqVh2B6FFyEZAlsyxCkgIRaEOnC7IUDOLIS19AOnlK+TwzGpoGsY8fxWa9GP23 ACH8c0eMVYf2KutAoJzSpVAsIONSs0jgw6DZXDxeNhkzkMwZ0COJIyMVY+SD/6kwztIh FkD6BhMtzokvzalXRir72oQASHYRMla7OwvH36OMPBRgdNA1hOfYt8/ut0x17oXlIoLg 0pL4bLuT9bvWuxbX6k8Hl1MMX3rOyFECcAtzJYGRrgcCsDaLtZ0u5CQgQVvhRCPdfhdj Zv+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gFmOdEnV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si15178959ejx.60.2019.11.05.12.29.18; Tue, 05 Nov 2019 12:29:41 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gFmOdEnV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727830AbfKEU0J (ORCPT + 99 others); Tue, 5 Nov 2019 15:26:09 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:38973 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfKEU0J (ORCPT ); Tue, 5 Nov 2019 15:26:09 -0500 Received: by mail-qk1-f195.google.com with SMTP id 15so22448757qkh.6 for ; Tue, 05 Nov 2019 12:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=WK0wm7UHiRNiCdFdcI7k8HaWnL7BzBlfZNe4kmd9HH4=; b=gFmOdEnVPBMFdorjFTghJIoMxqPnFfiDnHPKN9TFB4YjJD4i82NoHJq4FfVKCCoSIM 3Ok5fosUiDopRnLeyUNPm0BCe0Cx8FDIMXvdkX6WgnnFGTYayoghwf5C/eFj8Mijbshg i5tZB2BtfI1qduCvLHF+hfSOHRPbBeUOsnhgxeMQBKckOxthc4nxeoiOKRQvhukhIG2/ tPS4h1jk5iNfl219kVpj+prkqa3Sb7oPyDStbTrmzaw0kW7z9fPCutFYrcSJb4SMnK5e mYnHVIf+dDrq4Aj2RQRQhf9sgmh+VlUR9q0H+SW3DELxHpZCBjckTsaG0D3XTPC6dLk5 S1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WK0wm7UHiRNiCdFdcI7k8HaWnL7BzBlfZNe4kmd9HH4=; b=eJcHn5bkZIiQTO22DzAa6SRn6FNaODCIdZUSZUeiCLhM3wOXztdH72riu++N2v8gJQ mJ4b6JrdwMlb2Yy/NmLnmB0MGc7ooMnKHV5fTHjj7CzhOpUJXyG43/+weeqDg0GiR1BC jSAc3x+aZrJbZxLCsK50OkUxQOVdtSXJ6jKhGwSDqbE0nRu0rtjWDIq7G0uEMmF3c5Xf g52Q+w1X9gt6qiuqTdTnXvdTvN+IMtFQjK6DzvwzYMavnxnzCMabQdydOFFb/hiX9dyi wz9Ys962zxlyBwpU1cOgGY6yNCwmFVfN2a5N5dl3wOAspSreZPszMci+5EAWflecoAkw LyIQ== X-Gm-Message-State: APjAAAWjzaRlUVUPH45SXXGDNLLM28XVSGWwImYDgkc3FlwCa6gvm/V/ pqas1RBWQGRvg6mRuvU3yjIFbQ== X-Received: by 2002:a37:f905:: with SMTP id l5mr2109122qkj.90.1572985567586; Tue, 05 Nov 2019 12:26:07 -0800 (PST) Received: from [192.168.1.169] (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.gmail.com with ESMTPSA id k128sm2706418qkf.56.2019.11.05.12.26.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2019 12:26:06 -0800 (PST) Subject: Re: [Patch v4 6/6] sched: thermal: Enable tuning of decay period To: Ionela Voinescu References: <1571776465-29763-1-git-send-email-thara.gopinath@linaro.org> <1571776465-29763-7-git-send-email-thara.gopinath@linaro.org> <20191104161035.GA6680@e108754-lin> Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org From: Thara Gopinath Message-ID: <5DC1DADE.60603@linaro.org> Date: Tue, 5 Nov 2019 15:26:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20191104161035.GA6680@e108754-lin> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/04/2019 11:12 AM, Ionela Voinescu wrote: > Hi Thara, > > On Tuesday 22 Oct 2019 at 16:34:25 (-0400), Thara Gopinath wrote: >> Thermal pressure follows pelt signas which means the >> decay period for thermal pressure is the default pelt >> decay period. Depending on soc charecteristics and thermal >> activity, it might be beneficial to decay thermal pressure >> slower, but still in-tune with the pelt signals. > > I wonder if it can be beneficial to decay thermal pressure faster as > well. > > This implementation makes 32 (LOAD_AVG_PERIOD) the minimum half-life > of the thermal pressure samples. This results in more than 100ms for a > sample to decay significantly and therefore let's say it can take more > than 100ms for capacity to return to (close to) max when the CPU is no > longer capped. This value seems high to me considering that a minimum > value should result in close to 'instantaneous' behaviour, when there > are thermal capping mechanisms that can react in ~20ms (hikey960 has a > polling delay of 25ms, if I'm remembering correctly). > > I agree 32ms seems like a good default but given that you've made this > configurable as to give users options, I'm wondering if it would be > better to cover a wider range. > >> One way to achieve this is to provide a command line parameter >> to set the decay coefficient to an integer between 0 and 10. >> >> Signed-off-by: Thara Gopinath >> --- >> v3->v4: >> - Removed the sysctl setting to tune decay period and instead >> introduced a command line parameter to control it. The rationale >> here being changing decay period of a PELT signal runtime can >> result in a skewed average value for atleast some cycles. >> >> Documentation/admin-guide/kernel-parameters.txt | 5 +++++ >> kernel/sched/thermal.c | 25 ++++++++++++++++++++++++- >> 2 files changed, 29 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt >> index a84a83f..61d7baa 100644 >> --- a/Documentation/admin-guide/kernel-parameters.txt >> +++ b/Documentation/admin-guide/kernel-parameters.txt >> @@ -4273,6 +4273,11 @@ >> incurs a small amount of overhead in the scheduler >> but is useful for debugging and performance tuning. >> >> + sched_thermal_decay_coeff= >> + [KNL, SMP] Set decay coefficient for thermal pressure signal. >> + Format: integer betweer 0 and 10 >> + Default is 0. >> + >> skew_tick= [KNL] Offset the periodic timer tick per cpu to mitigate >> xtime_lock contention on larger systems, and/or RCU lock >> contention on all systems with CONFIG_MAXSMP set. >> diff --git a/kernel/sched/thermal.c b/kernel/sched/thermal.c >> index 0c84960..0da31e1 100644 >> --- a/kernel/sched/thermal.c >> +++ b/kernel/sched/thermal.c >> @@ -10,6 +10,28 @@ >> #include "pelt.h" >> #include "thermal.h" >> >> +/** >> + * By default the decay is the default pelt decay period. >> + * The decay coefficient can change is decay period in >> + * multiples of 32. > > This description has to be corrected as well, as per Peter's comment. > > Also, it might be good not to use the value 32 directly but to mention > that the decay period is a shift of LOAD_AVG_PERIOD. If that changes, > the translation from decay shift to decay period below will change as > well. Hi Ionela, I sent out the v5 without fixing this. Even if there are no other comments on v5 I will send out a v6 fixing this. Regarding a slower decay, we need a strong case for it. -- Warm Regards Thara