From: Marc Fiuczynski <mef@cs.princeton.edu>
Date: Thu, 21 Apr 2005 16:43:57 +0000 (+0000)
Subject: Pull forward Andy's share initialization fix [PL #4227].
X-Git-Tag: before-fedora-2_6_18-1_2239_FC5-vs2_0_2_2-rc6-merge~211
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f288ea7bdf9691219ef91ccd3cb843caa14bc16a;p=linux-2.6.git

Pull forward Andy's share initialization fix [PL #4227].
---

diff --git a/kernel/ckrm/ckrm_cpu_monitor.c b/kernel/ckrm/ckrm_cpu_monitor.c
index 3e18c9753..5f59b375e 100644
--- a/kernel/ckrm/ckrm_cpu_monitor.c
+++ b/kernel/ckrm/ckrm_cpu_monitor.c
@@ -841,8 +841,9 @@ static void adjust_lrq_weight(struct ckrm_cpu_class *clsptr, int cpu_online)
 		total_pressure += lrq->lrq_load;
 	}
 
-#if 1
-#warning "ACB taking out suspicious early return"
+#define FIX_SHARES 
+#ifdef FIX_SHARES
+#warning "ACB: fix share initialization problem [PL #4227]"
 #else
 	if (! total_pressure)
 		return;
@@ -859,6 +860,10 @@ static void adjust_lrq_weight(struct ckrm_cpu_class *clsptr, int cpu_online)
 			/*give idle class a high share to boost interactiveness */
 			lw = cpu_class_weight(clsptr); 
 		else {
+#ifdef FIX_SHARES
+		        if (! total_pressure)
+			        return;
+#endif			
 			lw = lrq->lrq_load * class_weight;
 			do_div(lw,total_pressure);
 			if (!lw)