public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Qais Yousef <qais.yousef@arm.com>,
	rickyiu@google.com, wvw@google.com,
	Patrick Bellasi <patrick.bellasi@matbug.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	kernel-team@android.com
Subject: Re: [PATCH] sched: Make uclamp changes depend on CAP_SYS_NICE
Date: Thu, 10 Jun 2021 07:45:29 +0000	[thread overview]
Message-ID: <YMHDGZM5d1DKm4lh@google.com> (raw)
In-Reply-To: <CAB8ipk_LY=9G5E8TcE3b7i3Ntfj+vJUuqSR7LWYn8=yOaTtCEg@mail.gmail.com>

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@google.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

      reply	other threads:[~2021-06-10  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 17:59 [PATCH] sched: Make uclamp changes depend on CAP_SYS_NICE Quentin Perret
2021-06-10  3:33 ` Xuewen Yan
2021-06-10  7:45   ` Quentin Perret [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMHDGZM5d1DKm4lh@google.com \
    --to=qperret@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=peterz@infradead.org \
    --cc=qais.yousef@arm.com \
    --cc=rickyiu@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=wvw@google.com \
    --cc=xuewen.yan94@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox