Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1649961ybz; Thu, 30 Apr 2020 03:07:29 -0700 (PDT) X-Google-Smtp-Source: APiQypIKAsVIl/ngoe6iy2D0guRsCrYTiLhYTB07Xq8KlWfAKs7ZLwd1y3mv1ocRLBfq3hIZkmXz X-Received: by 2002:aa7:d783:: with SMTP id s3mr1921086edq.64.1588241249480; Thu, 30 Apr 2020 03:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588241249; cv=none; d=google.com; s=arc-20160816; b=vWogMd/6LXkXtMEBltd81E2/1W7QcGJv5c3joVThwtnsJpEbqO1Gnt+3EaLhAjtBi4 baVwkSmHZS5HVsh2tJEuuNvLKKqcoejVh2qFWTR09AufF7Kb6aGixgXt3OebVOGFstIL firaNkn65GdqLzVJypTSa/XX3ikvdmrue1lGo3Yih4mlGIW1U3G4GDPaMzw4Sas+Pud8 7zCewhcPTaD7GdzTytIMszXmrsHELpCQnMql1VLGGUW/CEErHzMB0fuNkRusSX+LXNpc Xi5NF60u814d+Gvk1mRxoWvSKoxWmxjZ6iLfXqgEoBE8wM+7Pc7MHoUb7uDqWRSLmCY+ +86Q== 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; bh=voRqeZa5cw/4hYaQPoFVcXrCkrXBeUsr6fke2oKC2Ps=; b=HtPw8loIxBIb4vPwDekWQDKmRJSu9rEq+utf1p/fNECK5Vjk/3eT8uj4xi1HaCvAow R9QcOM/mSV/YKHLEnhqilsRoxipQOAS2HQPzrEzTc/qVO1jPMb00JFtsOzz715trV7bW zor8XghE9DdysWz+sveDFkWma1XpqGJ5lSCbbkPK1rEj7+v+NqmbASIcmGozfjVsUsZA kVW6+T/QbJeSsLjlPFjxUYDO+fYydmOhc2EzJJ2V9yROjCr0MdU7fWQW4ZY49z/RkoDC U0iOt85fclO+hz+sjwC+QbVCJDCkZQDrZ1yiOjz2rS8bImNsfJwG4/xTa+JwlfxkDqBL m9Vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si4693067edv.469.2020.04.30.03.07.06; Thu, 30 Apr 2020 03:07:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbgD3KDT (ORCPT + 99 others); Thu, 30 Apr 2020 06:03:19 -0400 Received: from foss.arm.com ([217.140.110.172]:51728 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726378AbgD3KDS (ORCPT ); Thu, 30 Apr 2020 06:03:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2A0311063; Thu, 30 Apr 2020 03:03:18 -0700 (PDT) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B787D3F68F; Thu, 30 Apr 2020 03:03:15 -0700 (PDT) Date: Thu, 30 Apr 2020 11:03:13 +0100 From: Qais Yousef To: Tao Zhou Cc: Peter Zijlstra , Ingo Molnar , Jonathan Corbet , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Luis Chamberlain , Kees Cook , Iurii Zaikin , Quentin Perret , Valentin Schneider , Patrick Bellasi , Pavan Kondeti , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 2/2] Documentation/sysctl: Document uclamp sysctl knobs Message-ID: <20200430100311.hcamfff363hl4bjk@e107158-lin> References: <20200428164134.5588-1-qais.yousef@arm.com> <20200428164134.5588-2-qais.yousef@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/30/20 13:06, Tao Zhou wrote: > Hi, > > On Tue, Apr 28, 2020 at 05:41:34PM +0100, Qais Yousef wrote: > > Uclamp exposes 3 sysctl knobs: > > > > * sched_util_clamp_min > > * sched_util_clamp_max > > * sched_util_clamp_min_rt_default > > > Document them in sysctl/kernel.rst. > > > > Signed-off-by: Qais Yousef > > CC: Jonathan Corbet > > CC: Juri Lelli > > CC: Vincent Guittot > > CC: Dietmar Eggemann > > CC: Steven Rostedt > > CC: Ben Segall > > CC: Mel Gorman > > CC: Luis Chamberlain > > CC: Kees Cook > > CC: Iurii Zaikin > > CC: Quentin Perret > > CC: Valentin Schneider > > CC: Patrick Bellasi > > CC: Pavan Kondeti > > CC: linux-doc@vger.kernel.org > > CC: linux-kernel@vger.kernel.org > > CC: linux-fsdevel@vger.kernel.org > > --- > > Documentation/admin-guide/sysctl/kernel.rst | 48 +++++++++++++++++++++ > > 1 file changed, 48 insertions(+) > > > > diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst > > index 0d427fd10941..e7255f71493c 100644 > > --- a/Documentation/admin-guide/sysctl/kernel.rst > > +++ b/Documentation/admin-guide/sysctl/kernel.rst > > @@ -940,6 +940,54 @@ Enables/disables scheduler statistics. Enabling this feature > > incurs a small amount of overhead in the scheduler but is > > useful for debugging and performance tuning. > > > > +sched_util_clamp_min: > > +===================== > > + > > +Max allowed *minimum* utilization. > > + > > +Default value is SCHED_CAPACITY_SCALE (1024), which is the maximum possible > > +value. > > + > > +It means that any requested uclamp.min value cannot be greater than > ^^^^^^^ > > Seems that 'greater' should be 'smaller'. > And the range is [sched_util_clamp_min:SCHED_CAPACITY_SCALE] > Uclamp request should not below this system value. > Or I am totally wrong for memory leak. No the range is [0:sched_util_clamp_min]. It is what it is implemented by this condition: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sched/core.c?h=v5.7-rc3#n913 So if the requested uclamp.min value is greater than sched_util_clamp_min, we return sched_util_clamp_min. Thanks -- Qais Yousef > > Thank you > > > +sched_util_clamp_min, ie: it is restricted to the range > > +[0:sched_util_clamp_min]. > > + > > +sched_util_clamp_max: > > +===================== > > + > > +Max allowed *maximum* utilization. > > + > > +Default value is SCHED_CAPACITY_SCALE (1024), which is the maximum possible > > +value. > > + > > +It means that any requested uclamp.max value cannot be greater than > > +sched_util_clamp_max, ie: it is restricted to the range > > +[0:sched_util_clamp_max]. > > + > > +sched_util_clamp_min_rt_default: > > +================================ > > + > > +By default Linux is tuned for performance. Which means that RT tasks always run > > +at the highest frequency and most capable (highest capacity) CPU (in > > +heterogeneous systems). > > + > > +Uclamp achieves this by setting the requested uclamp.min of all RT tasks to > > +SCHED_CAPACITY_SCALE (1024) by default. Which effectively boosts the tasks to > > +run at the highest frequency and bias them to run on the biggest CPU. > > + > > +This knob allows admins to change the default behavior when uclamp is being > > +used. In battery powered devices particularly, running at the maximum > > +capacity and frequency will increase energy consumption and shorten the battery > > +life. > > + > > +This knob is only effective for RT tasks which the user hasn't modified their > > +requested uclamp.min value via sched_setattr() syscall. > > + > > +This knob will not escape the constraint imposed by sched_util_clamp_min > > +defined above. > > + > > +Any modification is applied lazily on the next opportunity the scheduler needs > > +to calculate the effective value of uclamp.min of the task. > > > > seccomp > > ======= > > -- > > 2.17.1 > >