Skip to content

Commit

Permalink
sched/fair: Skip idle cfs_rq
Browse files Browse the repository at this point in the history
Don't waste time checking whether an idle cfs_rq could be the busiest
queue. Furthermore, this can end up selecting a cfs_rq with a high load
but being idle in case of migrate_load.

Signed-off-by: Vincent Guittot <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Valentin Schneider <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
vingu-linaro authored and Peter Zijlstra committed Jan 14, 2021
1 parent 8c1f560 commit fc488ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -9402,8 +9402,11 @@ static struct rq *find_busiest_queue(struct lb_env *env,
if (rt > env->fbq_type)
continue;

capacity = capacity_of(i);
nr_running = rq->cfs.h_nr_running;
if (!nr_running)
continue;

capacity = capacity_of(i);

/*
* For ASYM_CPUCAPACITY domains, don't pick a CPU that could
Expand Down

0 comments on commit fc488ff

Please sign in to comment.