Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5743470ybp; Tue, 15 Oct 2019 04:29:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcVNSAAWeX2fkc9MchtOslPlybAtAIghHjXmtyOxAZ2lyq77Bvvd7cFrAbUfIzQ0HL8rqC X-Received: by 2002:a17:907:20c5:: with SMTP id qq5mr33421575ejb.96.1571138992367; Tue, 15 Oct 2019 04:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571138992; cv=none; d=google.com; s=arc-20160816; b=MVyuEnqhdwckyBgXgNpavUh8IW/P01E1JS80zMSdirrnSqpQ4tFoJJJTlIt6atssbH 7gGaVlKa/bWIXg/E3osXB9D2U9v3h8AdFB6GZBXtMsWWzovkkIrApKdIKDIXltVP4gbW zvGr712C98m+xOK2PfO0tULFuQm4eokvHWXoA5Digh3weP/OOQKirpptx2q+BdhdvMkz i/b47gzAulimY9DCs+52q9UVPgI6IkzbS48YvjXM73q6Lg8POh8SY55Zj9XnmWTm87cw GwJUKJMel41ZFCkJjsD7hCLoCj+0AB612qfIZ7oBDg0FQ3TkuxMX5AbTp6+72JtanMLJ uUgQ== 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=J5yheL3IX266IN4jIyIMkFBu6ny3nuvQCGjA15FGlFU=; b=OvI7ip/lGHkhRtr0ewfbYjzpAVML4BcOIh048CCs5vcTrN6hUyuYQeM8mE9EIw8NPe 87kEO6m9n02qiRksbtNf6J81phtHLeaDUA6RV0gw0RzSKM8569UBt/2B9R4pguNVb+wq ArJqR4HCJ47jWcW0tKUeoqc4Qtfvc+Xwf3Rm8K7qV6VEdtfvoz9fFH2Ygsur68EjeBqG zRief7XX74bwbKWUd5IEnoMXdaCrT8nieKHfSzYKaHzWVhk/MEeFA20PsNCeRHJPB4Lm xr0hA7E7biyYEOuMHrRnGpfjRS+xKOen/ozhUDanna66Rl2dD5Lvs7o5rTSs1031gALo FqnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rQhpJMN3; 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 c24si13116755edt.364.2019.10.15.04.29.29; Tue, 15 Oct 2019 04:29:52 -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=rQhpJMN3; 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 S1727637AbfJOKO7 (ORCPT + 99 others); Tue, 15 Oct 2019 06:14:59 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53468 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727307AbfJOKO7 (ORCPT ); Tue, 15 Oct 2019 06:14:59 -0400 Received: by mail-wm1-f67.google.com with SMTP id i16so20192430wmd.3 for ; Tue, 15 Oct 2019 03:14:57 -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=J5yheL3IX266IN4jIyIMkFBu6ny3nuvQCGjA15FGlFU=; b=rQhpJMN3ETeGNYnGr6vKkJKi7/DA5qObaGMMZkRqGfUA/TXNqB7gnUXRSaEIhs/oP1 uBs5HNSCYCKf8DHC8Qz2MeD4hxTpAXJVmh/uKWA/vj1yT7eMRzMBOaDw1Hj9L9zWw4Tk nMyVHNVUErOQvAFnU7YMkgZ0F5MmUgYN9qb4E3rTQfNQh2Oys9F+gR1bNgEzft+C8QvX xPWESH5IaPS4X3X439h2I9VJPtbP5WSfsVTyF8ZPCfrQPDrBwYe+WAXqWOx7LXI3g5fl Q0IZqK5tKW9a9JfPC2UQ7fDWblOi9SXTNPeBwRLlnjmk4Q9p9V28zhcY7DdQWw280WtX p7aw== 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=J5yheL3IX266IN4jIyIMkFBu6ny3nuvQCGjA15FGlFU=; b=uBqCuUv6vuTwNYwrFwDg0zAEMvajeC4/bzuc79MJhAwcrp3NbJTTJmKmg6DltLKYvF DoRHzVFTyjPWJBWsgQfHFwEpNLFqe6+dAtL97ruYsDRUDEAJQHlkaTcpA1NFw1MhAVqN AqO9h2LX0dJyNh0mV0BgAqZosNTK0PgUcxZYtUZZErqa7ctGwM3I6yI0evG+dT9pV5Iw ceqXkuu1bO39CBr2j4Jn1knuKp4wOp9DICpLO3EooEGOhY3pUrY/FKt7QAqOvg9D2Wma f98SvLZvXpsNBHBqV5/0rbPOzJFyHwT3ISvb3aRninP8Ebnma1LkjVk4PzEb9Wzz1AeH cvxA== X-Gm-Message-State: APjAAAXXE20XEQtUfjOSyuISOv7+dAOw6DafzaU+Jlu25HugNU1bq3Pg AP4AYBkmeN7UZ13HvgiWn1s70KuUJzM= X-Received: by 2002:a1c:f60d:: with SMTP id w13mr19932536wmc.150.1571134496655; Tue, 15 Oct 2019 03:14:56 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:7687:11a4:4657:121d]) by smtp.gmail.com with ESMTPSA id s13sm21971318wmc.28.2019.10.15.03.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 03:14:55 -0700 (PDT) Date: Tue, 15 Oct 2019 11:14:52 +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 Subject: Re: [Patch v3 7/7] sched: thermal: Enable tuning of decay period Message-ID: <20191015101452.GA237548@google.com> References: <1571014705-19646-1-git-send-email-thara.gopinath@linaro.org> <1571014705-19646-8-git-send-email-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1571014705-19646-8-git-send-email-thara.gopinath@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 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. 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. Thanks, Quentin