public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: peterz@infradead.org
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Lukasz Luba <lukasz.luba@arm.com>,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	vincent.guittot@linaro.org, mgorman@suse.de,
	dietmar.eggemann@arm.com, juri.lelli@redhat.com,
	patrick.bellasi@matbug.com, tglx@linutronix.de,
	rostedt@goodmis.org
Subject: Re: [PATCH] sched/fair: Fix wrong negative conversion in find_energy_efficient_cpu()
Date: Mon, 10 Aug 2020 16:05:15 +0200	[thread overview]
Message-ID: <20200810140515.GY2674@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <jhjy2mmhhq6.mognet@arm.com>

On Mon, Aug 10, 2020 at 12:18:25PM +0100, Valentin Schneider wrote:
> 
> On 10/08/20 09:30, Lukasz Luba wrote:
> > In find_energy_efficient_cpu() 'cpu_cap' could be less that 'util'.
> > It might be because of RT, DL (so higher sched class than CFS), irq or
> > thermal pressure signal, which reduce the capacity value.
> > In such situation the result of 'cpu_cap - util' might be negative but
> > stored in the unsigned long. Then it might be compared with other unsigned
> > long when uclamp_rq_util_with() reduced the 'util' such that is passes the
> > fits_capacity() check.
> >
> > Prevent this situation and make the arithmetic more safe.
> >
> > Fixes: 1d42509e475cd ("sched/fair: Make EAS wakeup placement consider
> > uclamp restrictions")
> 
> I was going to say that might even go as far back as:
> 
>   732cd75b8c92 ("sched/fair: Select an energy-efficient CPU on task wake-up")
> 
> but we had a capacity fitness check in the right place back then, which I
> screwed over with that uclamp_rq_util_with() :/
> 
> LGTM, thanks for figuring that one out.
> 
> Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>

Thanks guys!

  reply	other threads:[~2020-08-10 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10  8:30 [PATCH] sched/fair: Fix wrong negative conversion in find_energy_efficient_cpu() Lukasz Luba
2020-08-10 11:18 ` Valentin Schneider
2020-08-10 14:05   ` peterz [this message]
2020-08-27  7:54 ` [tip: sched/core] " tip-bot2 for Lukasz Luba

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=20200810140515.GY2674@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=patrick.bellasi@matbug.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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