Re: 2.6.21-rc2-mm1: what about CONFIG_NO_HZ and !CONFIG_SMP ?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Siddha, Suresh B
Date: Friday, March 2, 2007 - 1:57 pm

On Fri, Mar 02, 2007 at 10:12:25PM +0100, Laurent Riffard wrote:

No. There is no such dependency. Can you please check if the below patch fixes
the compilation issue. Thanks.

---

Move trigger_load_balance() under ifdef CONFIG_SMP.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

diff -pNru linux-2.6.21-rc2/kernel/sched.c linux-mm/kernel/sched.c
--- linux-2.6.21-rc2/kernel/sched.c	2007-03-02 13:23:46.000000000 -0800
+++ linux-mm/kernel/sched.c	2007-03-02 13:26:38.000000000 -0800
@@ -3156,6 +3156,68 @@ static void run_rebalance_domains(struct
 	}
 #endif
 }
+
+/*
+ * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing.
+ *
+ * In case of CONFIG_NO_HZ, this is the place where we nominate a new
+ * idle load balancing owner or decide to stop the periodic load balancing,
+ * if the whole system is idle.
+ */
+static inline void trigger_load_balance(int cpu)
+{
+	struct rq *rq = cpu_rq(cpu);
+#ifdef CONFIG_NO_HZ
+	/*
+	 * If we were in the nohz mode recently and busy at the current
+	 * scheduler tick, then check if we need to nominate new idle
+	 * load balancer.
+	 */
+	if (rq->in_nohz_recently && !rq->idle_at_tick) {
+		rq->in_nohz_recently = 0;
+
+		if (atomic_read(&nohz.load_balancer) == cpu) {
+			cpu_clear(cpu, nohz.cpu_mask);
+			atomic_set(&nohz.load_balancer, -1);
+		}
+
+		if (atomic_read(&nohz.load_balancer) == -1) {
+			/*
+			 * simple selection for now: Nominate the
+			 * first cpu in the nohz list to be the next
+			 * ilb owner.
+			 *
+			 * TBD: Traverse the sched domains and nominate
+			 * the nearest cpu in the nohz.cpu_mask.
+			 */
+			int ilb = first_cpu(nohz.cpu_mask);
+
+			if (ilb != NR_CPUS)
+				resched_cpu(ilb);
+		}
+	}
+
+	/*
+	 * If this cpu is idle and doing idle load balancing for all the
+	 * cpus with ticks stopped, is it time for that to stop?
+	 */
+	if (rq->idle_at_tick && atomic_read(&nohz.load_balancer) == cpu &&
+	    cpus_weight(nohz.cpu_mask) == num_online_cpus()) {
+		resched_cpu(cpu);
+		return;
+	}
+
+	/*
+	 * If this cpu is idle and the idle load balancing is done by
+	 * someone else, then no need raise the SCHED_SOFTIRQ
+	 */
+	if (rq->idle_at_tick && atomic_read(&nohz.load_balancer) != cpu &&
+	    cpu_isset(cpu, nohz.cpu_mask))
+		return;
+#endif
+	if (time_after_eq(jiffies, rq->next_balance))
+		raise_softirq(SCHED_SOFTIRQ);
+}
 #else
 /*
  * on UP we do not need to balance between CPUs:
@@ -3366,68 +3428,6 @@ out_unlock:
 }
 
 /*
- * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing.
- *
- * In case of CONFIG_NO_HZ, this is the place where we nominate a new
- * idle load balancing owner or decide to stop the periodic load balancing,
- * if the whole system is idle.
- */
-static inline void trigger_load_balance(int cpu)
-{
-	struct rq *rq = cpu_rq(cpu);
-#ifdef CONFIG_NO_HZ
-	/*
-	 * If we were in the nohz mode recently and busy at the current
-	 * scheduler tick, then check if we need to nominate new idle
-	 * load balancer.
-	 */
-	if (rq->in_nohz_recently && !rq->idle_at_tick) {
-		rq->in_nohz_recently = 0;
-
-		if (atomic_read(&nohz.load_balancer) == cpu) {
-			cpu_clear(cpu, nohz.cpu_mask);
-			atomic_set(&nohz.load_balancer, -1);
-		}
-
-		if (atomic_read(&nohz.load_balancer) == -1) {
-			/*
-			 * simple selection for now: Nominate the
-			 * first cpu in the nohz list to be the next
-			 * ilb owner.
-			 *
-			 * TBD: Traverse the sched domains and nominate
-			 * the nearest cpu in the nohz.cpu_mask.
-			 */
-			int ilb = first_cpu(nohz.cpu_mask);
-
-			if (ilb != NR_CPUS)
-				resched_cpu(ilb);
-		}
-	}
-
-	/*
-	 * If this cpu is idle and doing idle load balancing for all the
-	 * cpus with ticks stopped, is it time for that to stop?
-	 */
-	if (rq->idle_at_tick && atomic_read(&nohz.load_balancer) == cpu &&
-	    cpus_weight(nohz.cpu_mask) == num_online_cpus()) {
-		resched_cpu(cpu);
-		return;
-	}
-
-	/*
-	 * If this cpu is idle and the idle load balancing is done by
-	 * someone else, then no need raise the SCHED_SOFTIRQ
-	 */
-	if (rq->idle_at_tick && atomic_read(&nohz.load_balancer) != cpu &&
-	    cpu_isset(cpu, nohz.cpu_mask))
-		return;
-#endif
-	if (time_after_eq(jiffies, rq->next_balance))
-		raise_softirq(SCHED_SOFTIRQ);
-}
-
-/*
  * This function gets called by the timer code, with HZ frequency.
  * We call it with interrupts disabled.
  *
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 4:00 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 4:04 am)
Re: 2.6.21-rc2-mm1, Russell King, (Fri Mar 2, 4:04 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 4:08 am)
Re: 2.6.21-rc2-mm1, Russell King, (Fri Mar 2, 4:10 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 4:15 am)
Re: 2.6.21-rc2-mm1, Bryan Wu, (Fri Mar 2, 7:24 am)
[-mm patch] cpu_idle: fix build break , Frederik Deweerdt, (Fri Mar 2, 7:40 am)
Re: [-mm patch] cpu_idle: fix build break, Venkatesh Pallipadi, (Fri Mar 2, 8:24 am)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Fri Mar 2, 8:56 am)
Re: 2.6.21-rc2-mm1 - fb_ddc_read() not defined, Valdis.Kletnieks, (Fri Mar 2, 9:03 am)
Re: [-mm patch] cpu_idle: fix build break, Frederik Deweerdt, (Fri Mar 2, 9:24 am)
Re: 2.6.21-rc2-mm1 - fb_ddc_read() not defined, James Simmons, (Fri Mar 2, 9:31 am)
Re: 2.6.21-rc2-mm1, Badari Pulavarty, (Fri Mar 2, 9:32 am)
Re: 2.6.21-rc2-mm1 - fb_ddc_read() not defined, Valdis.Kletnieks, (Fri Mar 2, 9:51 am)
[patch -mm] x86_64: fake numa cmdline flag fix, David Rientjes, (Fri Mar 2, 10:03 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 10:10 am)
Re: 2.6.21-rc2-mm1, Badari Pulavarty, (Fri Mar 2, 10:15 am)
Re: [patch -mm] x86_64: fake numa cmdline flag fix, Badari Pulavarty, (Fri Mar 2, 10:21 am)
Re: 2.6.21-rc2-mm1, Randy Dunlap, (Fri Mar 2, 10:30 am)
Re: 2.6.21-rc2-mm1: what about CONFIG_NO_HZ and !CONFIG_SMP ?, Siddha, Suresh B, (Fri Mar 2, 1:57 pm)
Re: 2.6.21-rc2-mm1: pata_via: wrong cable detection, Laurent Riffard, (Fri Mar 2, 3:52 pm)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Fri Mar 2, 4:42 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 5:40 pm)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Fri Mar 2, 6:22 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Fri Mar 2, 6:41 pm)
Re: 2.6.21-rc2-mm1 - build error with CONFIG_NO_HZ=y and C ..., Antonino A. Daplas, (Sat Mar 3, 12:45 am)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Sat Mar 3, 3:08 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Sat Mar 3, 5:06 am)
Re: 2.6.21-rc2-mm1, Russell King, (Sat Mar 3, 11:03 am)
Re: 2.6.21-rc2-mm1, Mariusz Kozlowski, (Sun Mar 4, 2:07 am)
Re: 2.6.21-rc2-mm1, Mariusz Kozlowski, (Sun Mar 4, 2:48 am)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Sun Mar 4, 4:34 am)
Re: 2.6.21-rc2-mm1, Mariusz Kozlowski, (Sun Mar 4, 5:01 am)
Re: 2.6.21-rc2-mm1, Mariusz Kozlowski, (Sun Mar 4, 10:06 am)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Sun Mar 4, 10:13 am)
Re: 2.6.21-rc2-mm1, Michal Piotrowski, (Sun Mar 4, 10:20 am)
Re: 2.6.21-rc2-mm1, J.A. , (Sun Mar 4, 5:11 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Sun Mar 4, 5:29 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Sun Mar 4, 6:17 pm)
[-mm patch] saa7134: fix MODULES=n compilation, Adrian Bunk, (Sun Mar 4, 6:47 pm)
2.6.21-rc2-mm1: drivers/net/wireless/ compile error, Adrian Bunk, (Sun Mar 4, 6:47 pm)
[-mm patch] drivers/cpuidle/: make code static, Adrian Bunk, (Sun Mar 4, 6:47 pm)
[-mm patch] make fb_deferred_io_mkwrite() static, Adrian Bunk, (Sun Mar 4, 6:49 pm)
[-mm patch] fix the ROMFS_* dependencies, Adrian Bunk, (Sun Mar 4, 6:49 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Mon Mar 5, 3:14 am)
Re: 2.6.21-rc2-mm1, Antonino A. Daplas, (Mon Mar 5, 3:30 am)
arm utrace, Roland McGrath, (Mon Mar 5, 3:41 am)
Re: 2.6.21-rc2-mm1: drivers/net/wireless/ compile error, Michael Buesch, (Mon Mar 5, 3:41 am)
Re: [-mm patch] fix the ROMFS_* dependencies , David Howells, (Mon Mar 5, 6:36 am)
Re: 2.6.21-rc2-mm1, Zan Lynx, (Mon Mar 5, 9:34 am)
Re: 2.6.21-rc2-mm1, J.A. , (Mon Mar 5, 3:20 pm)
Re: 2.6.21-rc2-mm1, Andrew Morton, (Mon Mar 5, 4:11 pm)
i2c vs nVidia [Re: 2.6.21-rc2-mm1], J.A. , (Mon Mar 5, 5:16 pm)
Re: i2c vs nVidia [Re: 2.6.21-rc2-mm1], Andrew Morton, (Mon Mar 5, 5:33 pm)
Re: i2c vs nVidia [Re: 2.6.21-rc2-mm1], Greg KH, (Mon Mar 5, 5:44 pm)
[PATCH] sched: fix idle at tick, Con Kolivas, (Mon Mar 5, 11:25 pm)
Re: i2c vs nVidia [Re: 2.6.21-rc2-mm1], Jean Delvare, (Tue Mar 6, 1:45 am)
Re: i2c vs nVidia [Re: 2.6.21-rc2-mm1], Jean Delvare, (Tue Mar 6, 3:56 am)
Re: [-mm patch] fix the ROMFS_* dependencies, Adrian Bunk, (Tue Mar 6, 4:43 pm)