]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched: reduce idle time
authorAndrew Morton <akpm@osdl.org>
Mon, 10 May 2004 06:29:30 +0000 (23:29 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 10 May 2004 06:29:30 +0000 (23:29 -0700)
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...

kernel/sched.c

index e1d1eebf840f105ba1c6568d91475ed826f936cb..cf210a3f8c8e81a3fe153e4e773221af2d71a47a 100644 (file)
@@ -1630,7 +1630,8 @@ nextgroup:
        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;
        }