RE: [PATCH] Revert "sched/fair: Fix O(nr_cgroups) in the load balancing path"

From: Doug Smythies
Date: Wed Oct 30 2019 - 10:04:52 EST


On 2019.10.29 09:02 Vincent Guittot wrote:

> Could you try the patch below ? It ensures that at least the root cfs rq stays
> in the list so each time update_blocked_averages is called, we will call update_cfs_rq_load_avg()
> for the root cfs_rq at least and even if everything already reach zero.
> This will ensure that cfs_rq_util_change is called even if nothing has
> changed.
>
> ---
> kernel/sched/fair.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 151c0b7..ac0a549 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7552,6 +7552,8 @@ static inline void update_blocked_load_status(struct rq *rq, bool has_blocked) {
>
> static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
> {
> + struct rq *rq = rq_of(cfs_rq);
> +
> if (cfs_rq->load.weight)
> return false;
>
> @@ -7564,6 +7566,9 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
> if (cfs_rq->avg.runnable_load_sum)
> return false;
>
> + if (cfs_rq == &rq->cfs)
> + return false;
> +
> return true;
> }
>
> --
> 2.7.4

Yes, this patch works and solves the long time
between calls of the intel_pstate CPU frequency scaling
driver issue.
I see you sent a formal patch a few hours ago.
I'll try it and report back.

... Doug