linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: preeti@linux.vnet.ibm.com (Preeti U Murthy)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 11/13] sched: Modify find_idlest_group to use PJT's metric
Date: Thu, 25 Oct 2012 15:56:06 +0530	[thread overview]
Message-ID: <20121025102605.21022.5545.stgit@preeti.in.ibm.com> (raw)
In-Reply-To: <20121025102045.21022.92489.stgit@preeti.in.ibm.com>

Additional parameters introduced to perform this function which are
calculated using PJT's metrics and its helpers.

Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
 kernel/sched/fair.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a5affbc..c64be1c1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3173,11 +3173,13 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
 		  int this_cpu, int load_idx)
 {
 	struct sched_group *idlest = NULL, *group = sd->groups;
-	unsigned long min_load = ULONG_MAX, this_load = 0;
+	unsigned long this_load = 0;
+	u64 min_sg_load = ~0ULL, this_sg_load = 0;/* Helpers for PJT's metrics */
 	int imbalance = 100 + (sd->imbalance_pct-100)/2;
 
 	do {
 		unsigned long load, avg_load;
+		u64 avg_sg_load;/* Helpers for PJT's metrics */
 		int local_group;
 		int i;
 
@@ -3191,6 +3193,7 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
 
 		/* Tally up the load of all CPUs in the group */
 		avg_load = 0;
+		avg_sg_load = 0;
 
 		for_each_cpu(i, sched_group_cpus(group)) {
 			/* Bias balancing toward cpus of our domain */
@@ -3200,20 +3203,23 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
 				load = target_load(i, load_idx);
 
 			avg_load += load;
+			avg_sg_load += cpu_rq(i)->cfs.runnable_load_avg;
 		}
 
 		/* Adjust by relative CPU power of the group */
 		avg_load = (avg_load * SCHED_POWER_SCALE) / group->sgp->power;
+		avg_sg_load = (avg_sg_load * SCHED_POWER_SCALE) / group->sgp->power;
 
 		if (local_group) {
 			this_load = avg_load;
-		} else if (avg_load < min_load) {
-			min_load = avg_load;
+			this_sg_load = avg_sg_load;
+		} else if (avg_sg_load < min_sg_load) {/* Decision changed to suit PJT's metric */
+			min_sg_load = avg_sg_load;
 			idlest = group;
 		}
 	} while (group = group->next, group != sd->groups);
 
-	if (!idlest || 100*this_load < imbalance*min_load)
+	if (!idlest || 100*this_sg_load < imbalance*min_sg_load)
 		return NULL;
 	return idlest;
 }

  parent reply	other threads:[~2012-10-25 10:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 10:24 [RFC PATCH 00/13] sched: Integrating Per-entity-load-tracking with the core scheduler Preeti U Murthy
2012-10-25 10:24 ` [RFC PATCH 01/13] sched:Prevent movement of short running tasks during load balancing Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 02/13] sched:Pick the apt busy sched group " Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 03/13] sched:Decide whether there be transfer of loads based on the PJT's metric Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 04/13] sched:Decide group_imb using " Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 05/13] sched:Calculate imbalance " Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 06/13] sched: Changing find_busiest_queue to use " Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 07/13] sched: Change move_tasks " Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 08/13] sched: Some miscallaneous changes in load_balance Preeti U Murthy
2012-10-25 10:25 ` [RFC PATCH 09/13] sched: Modify check_asym_packing to use PJT's metric Preeti U Murthy
2012-10-25 10:26 ` [RFC PATCH 10/13] sched: Modify fix_small_imbalance " Preeti U Murthy
2012-10-25 10:26 ` Preeti U Murthy [this message]
2012-10-25 10:26 ` [RFC PATCH 12/13] sched: Modify find_idlest_cpu " Preeti U Murthy
2012-10-25 10:26 ` [RFC PATCH 13/13] sched: Modifying wake_affine " Preeti U Murthy
2012-10-25 10:33 ` [RFC PATCH 00/13] sched: Integrating Per-entity-load-tracking with the core scheduler Preeti Murthy
2012-10-25 15:56 ` Peter Zijlstra
2012-10-25 18:00   ` Preeti U Murthy
2012-10-25 18:12   ` Preeti U Murthy
2012-10-26 12:29     ` Peter Zijlstra
2012-10-26 13:07       ` Ingo Molnar
2012-10-27  3:36         ` Preeti U Murthy
2012-10-27  3:33       ` Preeti U Murthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121025102605.21022.5545.stgit@preeti.in.ibm.com \
    --to=preeti@linux.vnet.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).