Re: [PATCH 00/10] steal tasks to improve CPU utilization

From: Peter Zijlstra
Date: Mon Oct 22 2018 - 13:07:02 EST


On Mon, Oct 22, 2018 at 07:59:31AM -0700, Steve Sistare wrote:
> When a CPU has no more CFS tasks to run, and idle_balance() fails to
> find a task, then attempt to steal a task from an overloaded CPU in the
> same LLC. Maintain and use a bitmap of overloaded CPUs to efficiently
> identify candidates. To minimize search time, steal the first migratable
> task that is found when the bitmap is traversed. For fairness, search
> for migratable tasks on an overloaded CPU in order of next to run.
>
> This simple stealing yields a higher CPU utilization than idle_balance()
> alone, because the search is cheap, so it may be called every time the CPU
> is about to go idle. idle_balance() does more work because it searches
> widely for the busiest queue, so to limit its CPU consumption, it declines
> to search if the system is too busy. Simple stealing does not offload the
> globally busiest queue, but it is much better than running nothing at all.

Why I don't dislike the idea; I feel it is unfortunate to have two
different mechanisms to do effectively the same thing.

Can't we improve idle_balance() instead of building this parallel
functionality?