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 04/13] sched:Decide group_imb using PJT's metric
Date: Thu, 25 Oct 2012 15:55:27 +0530	[thread overview]
Message-ID: <20121025102526.21022.64324.stgit@preeti.in.ibm.com> (raw)
In-Reply-To: <20121025102045.21022.92489.stgit@preeti.in.ibm.com>

Additional parameters for deciding a sched group's imbalance status
which are calculated using the per entity load tracking are used.

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

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 67a916d..77363c6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3748,6 +3748,7 @@ struct lb_env {
 	int			new_dst_cpu;
 	enum cpu_idle_type	idle;
 	long			imbalance;
+	long long               load_imbalance; /* PJT metric equivalent of imbalance */
 	/* The set of CPUs under consideration for load-balancing */
 	struct cpumask		*cpus;
 
@@ -4513,6 +4514,11 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 	unsigned long load, max_cpu_load, min_cpu_load;
 	unsigned int balance_cpu = -1, first_idle_cpu = 0;
 	unsigned long avg_load_per_task = 0;
+
+	/* Decide imb based on PJT's metric */
+	u64 cpu_runnable_load, max_cpu_runnable_load, min_cpu_runnable_load;
+	u64 avg_sg_load_per_task = 0;
+
 	int i;
 
 	if (local_group)
@@ -4521,6 +4527,8 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 	/* Tally up the load of all CPUs in the group */
 	max_cpu_load = 0;
 	min_cpu_load = ~0UL;
+	max_cpu_runnable_load = 0;
+	min_cpu_runnable_load = ~0ULL;
 	max_nr_running = 0;
 	min_nr_running = ~0UL;
 
@@ -4545,6 +4553,12 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 			if (min_cpu_load > load)
 				min_cpu_load = load;
 
+			cpu_runnable_load = cpu_rq(i)->cfs.runnable_load_avg;
+			if (cpu_runnable_load > max_cpu_runnable_load)
+				max_cpu_runnable_load = cpu_runnable_load;
+			if (min_cpu_runnable_load > cpu_runnable_load)
+				min_cpu_runnable_load = cpu_runnable_load;
+
 			if (nr_running > max_nr_running)
 				max_nr_running = nr_running;
 			if (min_nr_running > nr_running)
@@ -4604,10 +4618,13 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 	 *      normalized nr_running number somewhere that negates
 	 *      the hierarchy?
 	 */
-	if (sgs->sum_nr_running)
+	if (sgs->sum_nr_running) {
 		avg_load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running;
+		avg_sg_load_per_task = sgs->group_cfs_runnable_load / sgs->sum_nr_running;
+	}
 
-	if ((max_cpu_load - min_cpu_load) >= avg_load_per_task &&
+	/* The following decision is made on PJT's metric */
+	if ((max_cpu_runnable_load - min_cpu_runnable_load) >= avg_sg_load_per_task &&
 	    (max_nr_running - min_nr_running) > 1)
 		sgs->group_imb = 1;
 
@@ -5047,6 +5064,7 @@ out_balanced:
 
 ret:
 	env->imbalance = 0;
+	env->load_imbalance = 0;
 	return NULL;
 }
 

  parent reply	other threads:[~2012-10-25 10:25 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 ` Preeti U Murthy [this message]
2012-10-25 10:25 ` [RFC PATCH 05/13] sched:Calculate imbalance using " 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 ` [RFC PATCH 11/13] sched: Modify find_idlest_group " Preeti U Murthy
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=20121025102526.21022.64324.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).