Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391357 > unrolled thread

[PATCH 2/7] sched/fair: Fix comment in calculate_imbalance()

Started byDietmar Eggemann <dietmar.eggemann@arm.com>
First post2016-04-29 21:40 +0200
Last post2016-05-05 11:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/7] sched/fair: Fix comment in calculate_imbalance() Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-04-29 21:40 +0200
    [tip:sched/core] sched/fair: Fix comment in calculate_imbalance() tip-bot for Dietmar Eggemann <tipbot@zytor.com> - 2016-05-05 11:50 +0200

#1391357 — [PATCH 2/7] sched/fair: Fix comment in calculate_imbalance()

FromDietmar Eggemann <dietmar.eggemann@arm.com>
Date2016-04-29 21:40 +0200
Subject[PATCH 2/7] sched/fair: Fix comment in calculate_imbalance()
Message-ID<rtmqC-34w-17@gated-at.bofh.it>
The comment survived from commit 2dd73a4f09be ("[PATCH] sched:
implement smpnice") in which the selection of busiest and
busiest->avg_load (max_load) was based on if(avg_load > max_load
&& sum_nr_running > group->cpu_power / SCHED_LOAD_SCALE).

Commit b18855500fc4 ("sched/balancing: Fix 'local->avg_load >
sds->avg_load' case in calculate_imbalance()") added the second
operand of the or operator.

Update this comment accordingly and also use the current variable
names.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
 kernel/sched/fair.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c77e01b55ec2..bc19fee94f39 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6998,9 +6998,10 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
 	}
 
 	/*
-	 * In the presence of smp nice balancing, certain scenarios can have
-	 * max load less than avg load(as we skip the groups at or below
-	 * its cpu_capacity, while calculating max_load..)
+	 * Avg load of busiest sg can be less and avg load of local sg can
+	 * be greater than avg load across all sgs of sd because avg load
+	 * factors in sg capacity and sgs with smaller group_type are
+	 * skipped when updating the busiest sg.
 	 */
 	if (busiest->avg_load <= sds->avg_load ||
 	    local->avg_load >= sds->avg_load) {
-- 
1.9.1

[toc] | [next] | [standalone]


#1394980 — [tip:sched/core] sched/fair: Fix comment in calculate_imbalance()

Fromtip-bot for Dietmar Eggemann <tipbot@zytor.com>
Date2016-05-05 11:50 +0200
Subject[tip:sched/core] sched/fair: Fix comment in calculate_imbalance()
Message-ID<rvo4W-5Xt-7@gated-at.bofh.it>
In reply to#1391357
Commit-ID:  885e542ce827f5f102fe9628d63c6430c8b7ab2c
Gitweb:     http://git.kernel.org/tip/885e542ce827f5f102fe9628d63c6430c8b7ab2c
Author:     Dietmar Eggemann <dietmar.eggemann@arm.com>
AuthorDate: Fri, 29 Apr 2016 20:32:39 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 May 2016 09:41:10 +0200

sched/fair: Fix comment in calculate_imbalance()

The comment in calculate_imbalance() was introduced in commit:

 2dd73a4f09be ("[PATCH] sched: implement smpnice")

which described the logic as it was then, but a later commit:

  b18855500fc4 ("sched/balancing: Fix 'local->avg_load > sds->avg_load' case in calculate_imbalance()")

.. complicated this logic some more so that the comment does not match anymore.

Update the comment to match the code.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1461958364-675-3-git-send-email-dietmar.eggemann@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/fair.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 537d71e..51f7a4b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7000,9 +7000,10 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
 	}
 
 	/*
-	 * In the presence of smp nice balancing, certain scenarios can have
-	 * max load less than avg load(as we skip the groups at or below
-	 * its cpu_capacity, while calculating max_load..)
+	 * Avg load of busiest sg can be less and avg load of local sg can
+	 * be greater than avg load across all sgs of sd because avg load
+	 * factors in sg capacity and sgs with smaller group_type are
+	 * skipped when updating the busiest sg:
 	 */
 	if (busiest->avg_load <= sds->avg_load ||
 	    local->avg_load >= sds->avg_load) {

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web