Re: [PATCH v4 05/11] sched/fair: use rq->nr_running when balancing load

From: Mel Gorman
Date: Wed Oct 30 2019 - 12:01:40 EST


On Fri, Oct 18, 2019 at 03:26:32PM +0200, Vincent Guittot wrote:
> cfs load_balance only takes care of CFS tasks whereas CPUs can be used by
> other scheduling class. Typically, a CFS task preempted by a RT or deadline
> task will not get a chance to be pulled on another CPU because the
> load_balance doesn't take into account tasks from other classes.
> Add sum of nr_running in the statistics and use it to detect such
> situation.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>

Patch is ok but it'll be easier in the future to mix up sum_nr_running
and sum_h_nr_running in the future. Might be best to make sum_nr_running
sum_any_running and the hierarchy one sum_cfs_running. I don't feel
strongly either way, because it's almost certainly due to the fact I
almost never care about non-cfs tasks when thinking about the scheduler.

--
Mel Gorman
SUSE Labs