Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4757597ybg; Mon, 21 Oct 2019 14:04:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB/OUfJtzzDysJMD4VJAVnojH4e7wJwaAHps3Eye6xfIcNbBXG+26HG6MomMkS4HAMFHxI X-Received: by 2002:a05:6402:3c5:: with SMTP id t5mr26637217edw.125.1571691883151; Mon, 21 Oct 2019 14:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571691883; cv=none; d=google.com; s=arc-20160816; b=ODkzyz9OQA61gmxvkk9Z6vJQnpPjc+mqBbx1UVOqxYUyH4sszx2B+U61usdw6Gmgl8 BwVmkwsqhdnM/uRzSIiE8Lx7un9m/n8DfN/cVCtviYceuU62xWgWmXjdoct3WlWh3pOo jqhyq6LhEIYOyJISmRzgMXeR2aIOLWR8evC95b6qk63uQUODt8ssZuZBYtesQoQS3hfi wcId029eDtl9yy7ic1nMqHj8AP+0JieEZ8OlZXswMb3zMMeAuYtRD1VWOaYM83Iezq/p Fm1xO9l1d96z59cS8yLc7uAT5O1sbssjPWeZl/X7D1mwV98TfpUj5n1mWcXizCT1lLZr M/iQ== 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=nmmE+tP3DDwbQMMti1c8oIlUXbXa4eZTH+dE14lntAc=; b=Wq3rslYvjS24asukIsLZY+fMy3Z25GzhLNOqMgDo8hDmB52ohDca1JrTBZeBDMMFMw KRLkH/XHeFxbboRttaIyk/SizCRgGCd+lWMbzdQ4dU4XEAwP3Z0au3jyP9IfYIaLnrA4 lnpw9kReo89L8DQy0CDFOleozpsGlCgS1UyaysAZBIwH26RrUn/JPNNEMZWDZb8zTpI9 BCHy3YGDx6Hhk4OafdT6Oavxtr9tEKA3PE4ZH4Da6RGE1Nt1eFCtzBtZKZ7yk0BzFfke pFNUwIdsUlGsNrN0EFo7nLi1nkQ/aPsQNIOV/VK2o7JFcERlWtcEbd8LuRfgMU22v2Vy HXvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xDlWwKAo; 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 s14si11026783edc.83.2019.10.21.14.04.17; Mon, 21 Oct 2019 14:04:43 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xDlWwKAo; 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 S1730203AbfJUVEA (ORCPT + 99 others); Mon, 21 Oct 2019 17:04:00 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43340 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728943AbfJUVEA (ORCPT ); Mon, 21 Oct 2019 17:04:00 -0400 Received: by mail-qk1-f193.google.com with SMTP id a194so10095332qkg.10 for ; Mon, 21 Oct 2019 14:03:59 -0700 (PDT) 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=nmmE+tP3DDwbQMMti1c8oIlUXbXa4eZTH+dE14lntAc=; b=xDlWwKAoVigd2nyp0APe3pK7HfgxOBecUUi1J2+FpXEw5MukI+4lDzJwZL+IwCLQ09 yHCeXa/4EME5H+e7O/Xt99QYV0bUvXj2tNPfNbRTclMCk48hkRoW6I3Oo50b5/mr6gXq D0REdxaKel9Ve5B2Wo/M3mFgNZoRqvQybbs4F6ODZBCNMrIe9aKpTKu/e9uMQ8bz8W9h XdDKMcPMliCKizaMAnOB4RkhZSAWc4jurrIgR4b9BzxdcUrMkM6wdlRSaNp1BNORTR/K uF+WOOm8FRrjgVtpHVDgDgzLFSGUsm2b5HDMGEZ7a9fQCtBifqNOoGOsh7L7uDe0wZIq L4vA== 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=nmmE+tP3DDwbQMMti1c8oIlUXbXa4eZTH+dE14lntAc=; b=Y921RHmb2o/wdXryF5JHvxaY1RpTjr3nIQYXR2ipbaf1fkw695MnG2vK0XyfMPm1td I+CG8MDgFzXuluzgQD7timn4x8je8XP5XWXr5SP3hvRniVwNpL7jGaWU8kgltm6y22Gx bwcPbz9cTNNHigD5xy8yFYVt1k6ZHZA1Rt2TryjtGZECLYdQEjn2m8sbf1zwdeLhu0D7 LS+nxFKr6ne3bDAMsfgpVxikm8QiiH3HX/HZh+vaqzOlPEhanDzpHC/Zb+6MQUJFG3Ad p0/Mfb90WPpoOyyhZwkY+d+Lh2fMM4G0qfvYlnyMLGf2k9uZ9v14O3QXq0zE8n/BriUm OsuQ== X-Gm-Message-State: APjAAAUU5Qk9uMUqvvG+Nxk+sKlROo+yh1oTMEYvzsQbcYWxAnP3Bq7u KNnIlt+8L4x9+l5cwf952OPJiLdnSuk= X-Received: by 2002:ae9:dd07:: with SMTP id r7mr24687548qkf.248.1571691838732; Mon, 21 Oct 2019 14:03:58 -0700 (PDT) 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 y29sm7491267qtc.8.2019.10.21.14.03.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2019 14:03:57 -0700 (PDT) Subject: Re: [Patch v3 7/7] sched: thermal: Enable tuning of decay period To: Quentin Perret References: <1571014705-19646-1-git-send-email-thara.gopinath@linaro.org> <1571014705-19646-8-git-send-email-thara.gopinath@linaro.org> <20191015101452.GA237548@google.com> Cc: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org From: Thara Gopinath Message-ID: <5DAE1D3C.4090008@linaro.org> Date: Mon, 21 Oct 2019 17:03:56 -0400 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: <20191015101452.GA237548@google.com> 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 Hi Quentin, Thanks for the review. On 10/15/2019 06:14 AM, Quentin Perret wrote: > Hi Thara, > > On Sunday 13 Oct 2019 at 20:58:25 (-0400), Thara Gopinath wrote: >> diff --git a/kernel/sysctl.c b/kernel/sysctl.c >> index 00fcea2..5056c08 100644 >> --- a/kernel/sysctl.c >> +++ b/kernel/sysctl.c >> @@ -376,6 +376,13 @@ static struct ctl_table kern_table[] = { >> .mode = 0644, >> .proc_handler = proc_dointvec, >> }, >> + { >> + .procname = "sched_thermal_decay_coeff", >> + .data = &sysctl_sched_thermal_decay_coeff, >> + .maxlen = sizeof(unsigned int), >> + .mode = 0644, >> + .proc_handler = proc_dointvec, > > Perhaps change this for 'sched_proc_update_handler' with min and max > values ? Otherwise userspace is allowed to write nonsensical values > here. And since sysctl_sched_thermal_decay_coeff is used to shift, this > can lead to an undefined behaviour. Will do > > Also, could we take this sysctl out of SCHED_DEBUG ? I expect this to be > used/tuned on production devices where SCHED_DEBUG should theoretically > be off. I will take it out of SCHED_DEBUG. I am wondering if this should be a runtime control at all. Because this is a shift this changes the accumulating window for the thermal pressure signal. A runtime change will not guarantee a clean start of the window. May be I should make this a config option. > > Thanks, > Quentin > -- Warm Regards Thara