[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200420150839.ysh3ijfjftyzg7jw@e107158-lin.cambridge.arm.com>
Date: Mon, 20 Apr 2020 16:08:40 +0100
From: Qais Yousef <qais.yousef@....com>
To: Quentin Perret <qperret@...gle.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Jonathan Corbet <corbet@....net>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Iurii Zaikin <yzaikin@...gle.com>,
Valentin Schneider <valentin.schneider@....com>,
Patrick Bellasi <patrick.bellasi@...bug.net>,
Pavan Kondeti <pkondeti@...eaurora.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 1/2] sched/uclamp: Add a new sysctl to control RT default
boost value
Hi Quentin
On 04/15/20 11:11, Quentin Perret wrote:
> Hi Qais,
>
> On Friday 03 Apr 2020 at 13:30:19 (+0100), Qais Yousef wrote:
> <snip>
> > + /*
> > + * The new value will be applied to all RT tasks the next time they
> > + * wakeup, assuming the task is using the system default and not a user
> > + * specified value. In the latter we shall leave the value as the user
> > + * requested.
> > + */
> > if (sysctl_sched_uclamp_util_min > sysctl_sched_uclamp_util_max ||
> > sysctl_sched_uclamp_util_max > SCHED_CAPACITY_SCALE) {
> > result = -EINVAL;
> > goto undo;
> > }
> >
> > + if (sysctl_sched_rt_default_uclamp_util_min > SCHED_CAPACITY_SCALE) {
> > + result = -EINVAL;
> > + goto undo;
> > + }
>
> Hmm, checking:
>
> if (sysctl_sched_rt_default_uclamp_util_min > sysctl_sched_uclamp_util_min)
>
> would probably make sense too, but then that would make writing in
> sysctl_sched_uclamp_util_min cumbersome for sysadmins as they'd need to
> lower the rt default first. Is that the reason for checking against
> SCHED_CAPACITY_SCALE? That might deserve a comment or something.
There's no need for that extra diff. That constraint will be applied
automatically when calculating the effective value.
The check for SCHED_CAPACITY_SCALE is a a range check. The possible value is
[0:SCHED_CAPACITY_SCALE].
Does this answer your question? I could add a comment that all the uclamp
sysctls need to be within this range.
>
> <snip>
> > @@ -1241,9 +1293,13 @@ static void uclamp_fork(struct task_struct *p)
> > for_each_clamp_id(clamp_id) {
> > unsigned int clamp_value = uclamp_none(clamp_id);
> >
> > - /* By default, RT tasks always get 100% boost */
> > + /*
> > + * By default, RT tasks always get 100% boost, which the admins
> > + * are allowed to change via
> > + * sysctl_sched_rt_default_uclamp_util_min knob.
> > + */
> > if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN))
> > - clamp_value = uclamp_none(UCLAMP_MAX);
> > + clamp_value = sysctl_sched_rt_default_uclamp_util_min;
> >
> > uclamp_se_set(&p->uclamp_req[clamp_id], clamp_value, false);
> > }
>
> And that, as per 20200414161320.251897-1-qperret@...gle.com, should not
> be there :)
Yep saw it. Thanks for fixing it!
>
> Otherwise the patch pretty looks good to me!
Cheers
--
Qais Yousef
Powered by blists - more mailing lists