[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200106102341.GM2810@hirez.programming.kicks-ass.net>
Date: Mon, 6 Jan 2020 11:23:41 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Peng Liu <iwtbavbm@...il.com>
Cc: linux-kernel@...r.kernel.org, mingo@...hat.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, qais.yousef@....com, morten.rasmussen@....com,
valentin.schneider@....com
Subject: Re: [PATCH v2] sched/fair: fix sgc->{min,max}_capacity miscalculate
On Sat, Jan 04, 2020 at 09:08:28PM +0800, Peng Liu wrote:
> commit bf475ce0a3dd ("sched/fair: Add per-CPU min capacity to
> sched_group_capacity") introduced per-cpu min_capacity.
>
> commit e3d6d0cb66f2 ("sched/fair: Add sched_group per-CPU max capacity")
> introduced per-cpu max_capacity.
>
> Here, capacity is the accumulated sum of (maybe) many CPUs' capacity.
> Compare with capacity to get {min,max}_capacity makes no sense. Instead,
> we should compare one by one in each iteration to get
> sgc->{min,max}_capacity of the group.
>
> Also, the only CPU in rq->sd->groups should be rq's CPU. Thus,
> capacity_of(cpu_of(rq)) should be equal to rq->sd->groups->sgc->capacity.
> Code can be simplified by removing the if/else.
>
> Signed-off-by: Peng Liu <iwtbavbm@...il.com>
> Reviewed-by: Valentin Schneider <valentin.schneider@....com>
> ---
> v1: https://lkml.org/lkml/2019/12/30/502
Please (for future use); use the form:
https://lkml.kernel.org/r/$msgid
Powered by blists - more mailing lists