From: Nick Piggin <nickpiggin@yahoo.com.au>
It makes NEWLY_IDLE balances cause find_busiest_group return the busiest
available group even if there isn't an imbalance. Basically - try a bit
harder to prevent schedule emptying the runqueue.
It is quite aggressive, but that isn't so bad because we don't (by default)
do NEWLY_IDLE balancing across NUMA nodes, and NEWLY_IDLE balancing is always
restricted to cache_hot tasks.
It picked up a little bit of idle time that dbt2-pgsql was seeing...
return busiest;
out_balanced:
- if (busiest && idle != NOT_IDLE && max_load > SCHED_LOAD_SCALE) {
+ if (busiest && (idle == NEWLY_IDLE ||
+ (idle == IDLE && max_load > SCHED_LOAD_SCALE)) ) {
*imbalance = 1;
return busiest;
}