[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YMHDGZM5d1DKm4lh@google.com>
Date: Thu, 10 Jun 2021 07:45:29 +0000
From: Quentin Perret <qperret@...gle.com>
To: Xuewen Yan <xuewen.yan94@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Qais Yousef <qais.yousef@....com>, rickyiu@...gle.com,
wvw@...gle.com, Patrick Bellasi <patrick.bellasi@...bug.net>,
linux-kernel <linux-kernel@...r.kernel.org>,
kernel-team@...roid.com
Subject: Re: [PATCH] sched: Make uclamp changes depend on CAP_SYS_NICE
On Thursday 10 Jun 2021 at 11:33:04 (+0800), Xuewen Yan wrote:
> On Thu, Jun 10, 2021 at 2:16 AM Quentin Perret <qperret@...gle.com> wrote:
> > +static bool uclamp_reduce(struct task_struct *p, const struct sched_attr *attr)
> > +{
> > + int util_min, util_max;
> > +
> > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) {
> > + util_min = p->uclamp_req[UCLAMP_MIN].value;
> > + if (attr->sched_util_min > util_min)
> > + return false;
> > + }
> > +
> > + if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MAX) {
> > + util_max = p->uclamp_req[UCLAMP_MAX].value;
> > + if (attr->sched_util_max > util_max)
> > + return false;
>
> when the attr->sched_util_max = -1, and the util_max < 1024, here may
> should return false, but it would return ture.
Aha, indeed, I missed that -1 could be used to reset the clamps. I'll
send a v2.
Thanks!
Quentin
Powered by blists - more mailing lists