Skip to contentSkip to conversation

sched:make ads.avg_load update in time

PATCH In review Alex Shi 1 participant 2 messages Apr 15, 2011 1 message not in the archive

lore
Share & tools
lore

Alex Shi

author
#0 lore raw

PATCH 1/1 sched:make ads.avg_load update in time

commit 866ab43efd325fae cause hackbench benchmark process mode performance dropping about 15% on our x86_64 machines. The patch works as its origin purpose, but it cause nearly double context switch on hackbench running. The sds.avg_load was not updated in time cause this. So when move the sds.avg_load update before group_imb checking, performance recovered totally.

---
 kernel/sched_fair.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/sched_fair.c +2 -1
index 7f00772..036b660 100644
@@ -3127,6 +3127,8 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
 	if (!sds.busiest || sds.busiest_nr_running == 0)
 		goto out_balanced;
 
+	sds->avg_load = (SCHED_LOAD_SCALE * sds->total_load) / sds->total_pwr;
+
 	/*
 	 * If the busiest group is imbalanced the below checks don't
 	 * work because they assumes all things are equal, which typically
@@ -3151,7 +3153,6 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
 	 * Don't pull any tasks if this group is already above the domain
 	 * average load.
 	 */
-	sds.avg_load = (SCHED_LOAD_SCALE * sds.total_load) / sds.total_pwr;
 	if (sds.this_load >= sds.avg_load)
 		goto out_balanced;
 
Signature · 1 line
1.7.0

A message that is not in the archive (sent off-list or not yet received): [email protected]