Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5571133ybg; Tue, 22 Oct 2019 05:23:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLRz/o1LPSwpYTQrUIIrlibFOjvZN4BPOIe4sPpRvnO8woBM5YEiKrRyIdfu50KZ6tA0xs X-Received: by 2002:aa7:dcd4:: with SMTP id w20mr11568664edu.52.1571747038457; Tue, 22 Oct 2019 05:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571747038; cv=none; d=google.com; s=arc-20160816; b=NrAFussKEKr95cg3122Jg9iTel4VK5k5prk2AGZItFLgcvhIp3mdZXjxYSHojIxCaE LtJ/K+RcHG8ltDCM3sHOQgckV5WL5P3z0M/yqNU0DgCle3KAi82D/Z6eYWi+AHPjcdaj B3Dsgoe2/VHC2mW0Kqey6qHLfg9Q4uggFhCrXxGKDBqJrI36nH4htkl4gGyibIGjAsB3 Y7VuiCZPIdsHZFXGP19ssw1EEjsBeGD6AR2/wAuEG6Ic8E6UR6kJE4Njbpcw++5OA6GG 05uNa5vguvofJkJLFAcMG7toDwyDaWt+XtqmwIPEZ7ibKg3DugyD7QwXfeYvZkd1ZNcj b8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bp2iOqaf9LPVHmd5HtUEKhnME9NictImQqdOY1hvOdI=; b=TjZE02PFsKqNkFmNNyjPwWhzymVwhdC9730IB83BZYIPsz4Ray5vduPLjSI2KzEhKu 7pn2vkAeAV6lO/SjtFHhYkJSpDs/ZOUClIrQJmDTN+cm/nHTgSK5i35YKRsiD8s573wt B7C2U2vneOyeBG+HIW0rJ9Q4nsuGXIhpoLQI9gWQcvlqYxn1BSOZL2aKTHctv9JtYWUc Kkx/3+CKl8gu94LsVrNqhq31oN7SCCrqO0zvk8wIz5DQMNBnv3sUYdvRXiBxS8sF1WGI OcGQt++Xdex5kHWW2keHmYaGipRUEl3kVN+zNqQm/Cp1hhDRksuRGN9y2+3y8rjauaFI G68A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Spb7gnPO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si9972600ejk.264.2019.10.22.05.23.33; Tue, 22 Oct 2019 05:23:58 -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=@google.com header.s=20161025 header.b=Spb7gnPO; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388342AbfJVJDm (ORCPT + 99 others); Tue, 22 Oct 2019 05:03:42 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52346 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387695AbfJVJDm (ORCPT ); Tue, 22 Oct 2019 05:03:42 -0400 Received: by mail-wm1-f65.google.com with SMTP id r19so16281288wmh.2 for ; Tue, 22 Oct 2019 02:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bp2iOqaf9LPVHmd5HtUEKhnME9NictImQqdOY1hvOdI=; b=Spb7gnPOh/cAOxG1U92VtTvGpsT5DcIlqrJ9yqPaIBmxv/n9o1y/v19mWsGxjqxcL6 1TLEywnSmEHxzMXd8+XFgGI0eVMkNfIQlXJrbSWkHTb13ztm3k6mGwC8LilKr2v1+ViV lOwFeYc1mC60fsR1rl4syq2Mo/gaZtKYOQ26BMfmKF/qEXTybt/1NQi4cGjDzjtycuLg 2uGpLeF7gLodwoinb+Jqhv5rAGrwvCUmu7Axc8bH5W0sqdo1pyrIYKT/3ShKMjeF6o0b YNA99P9KBjZsCHitc27jelTJpaOoenBJKHHoC6rGxPmjcAgeo7GoRXhiI4TpgB+hsD+6 Ha9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bp2iOqaf9LPVHmd5HtUEKhnME9NictImQqdOY1hvOdI=; b=qviy0h0bEJxqYTjf6zO3Z/b3GvBvcxb+v0NAa6kEi8pevVDDjGCtTwkp1HdGJssHUu CVMEsNo+0BNrvEyKNo0UL1fTBABmMzv5kbG2GKHMyBHXmXaXo1z7ioz2fI3ktM8AGW4o WiJ+m7xj7NW5REWDnknDZAKrCQzpVRuT1coRWjBPiFOCjgW6hSwGe0IWOO3bBXfhoSkR xk+E07JjFqXJNsb7SZkTFBx4vqW8++8Qq9VbOwUKaSseaNPavzEJZtk8e0sQs9jgpzcB dINN7F+fF+QADoDWpN0ioWKyRje75Jd1wAJGWG6tkwijCRPkEaGfWpPbz996QPUV5oTq +1jA== X-Gm-Message-State: APjAAAVDAnE8pCGYP8hPPJETq/Rvky51TmoDYD5w373QsoAUJnUDG2pv cU7DTRjifSf/wsF1w/esrzgVlg== X-Received: by 2002:a05:600c:2387:: with SMTP id m7mr1908871wma.137.1571735018347; Tue, 22 Oct 2019 02:03:38 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:7687:11a4:4657:121d]) by smtp.gmail.com with ESMTPSA id g184sm10890549wma.8.2019.10.22.02.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 02:03:37 -0700 (PDT) Date: Tue, 22 Oct 2019 10:03:34 +0100 From: Quentin Perret To: Thara Gopinath 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, kernel-team@android.com Subject: Re: [Patch v3 7/7] sched: thermal: Enable tuning of decay period Message-ID: <20191022090334.GA85349@google.com> 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> <5DAE1D3C.4090008@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5DAE1D3C.4090008@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thara, On Monday 21 Oct 2019 at 17:03:56 (-0400), Thara Gopinath wrote: > 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. I'd personally prefer if it wan't a Kconfig option. We'd like to make Android devices (which are going to use this) work with a Generic Kernel Image, which means there will be a single config for everyone. But I expect this knob to be tuned to different values depending on the SoC. If you really don't want a sysctl, perhaps a cmdline option could work ? Thanks, Quentin