[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200810140515.GY2674@hirez.programming.kicks-ass.net>
Date: Mon, 10 Aug 2020 16:05:15 +0200
From: peterz@...radead.org
To: Valentin Schneider <valentin.schneider@....com>
Cc: Lukasz Luba <lukasz.luba@....com>, linux-kernel@...r.kernel.org,
mingo@...nel.org, vincent.guittot@...aro.org, mgorman@...e.de,
dietmar.eggemann@....com, juri.lelli@...hat.com,
patrick.bellasi@...bug.com, tglx@...utronix.de, rostedt@...dmis.org
Subject: Re: [PATCH] sched/fair: Fix wrong negative conversion in
find_energy_efficient_cpu()
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@....com>
Thanks guys!
Powered by blists - more mailing lists