]> Git Repo - linux.git/commitdiff
sched: Fix load balancing performance regression in should_we_balance()
authorJoonsoo Kim <[email protected]>
Tue, 10 Sep 2013 06:54:49 +0000 (15:54 +0900)
committerIngo Molnar <[email protected]>
Tue, 10 Sep 2013 07:20:42 +0000 (09:20 +0200)
Commit 23f0d20 ("sched: Factor out code to should_we_balance()")
introduces the should_we_balance() function.  This function should
return 1 if this cpu is appropriate for balancing. But the newly
introduced code doesn't do so, it returns 0 instead of 1.

This introduces performance regression, reported by Dave Chinner:

                        v4 filesystem           v5 filesystem
3.11+xfsdev:            220k files/s            225k files/s
3.12-git                180k files/s            185k files/s
3.12-git-revert         245k files/s            247k files/s

You can find more detailed information at:

  https://lkml.org/lkml/2013/9/10/1

This patch corrects the return value of should_we_balance()
function as orignally intended.

With this patch, Dave Chinner reports that the regression is gone:

                        v4 filesystem           v5 filesystem
3.11+xfsdev:            220k files/s            225k files/s
3.12-git                180k files/s            185k files/s
3.12-git-revert         245k files/s            247k files/s
3.12-git-fix            249k files/s            248k files/s

Reported-by: Dave Chinner <[email protected]>
Tested-by: Dave Chinner <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>
Cc: Paul Turner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Dave Chinner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched/fair.c

index 7f0a5e6cdae0e03db16a8c8fec5bd48ba1f893af..9b3fe1cd8f40c90a67381be209db1a49dad6f6f7 100644 (file)
@@ -5151,7 +5151,7 @@ static int should_we_balance(struct lb_env *env)
         * First idle cpu or the first cpu(busiest) in this sched group
         * is eligible for doing load balancing at this and above domains.
         */
-       return balance_cpu != env->dst_cpu;
+       return balance_cpu == env->dst_cpu;
 }
 
 /*
This page took 0.06183 seconds and 4 git commands to generate.