aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2011-08-10 17:21:01 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2013-04-03 07:56:03 -0400
commit3451d0243c3cdfd729b36f9684a14659d4895ca3 (patch)
tree5307f4492708ae089dd0a6d81b54f9e606707ca8 /kernel/sched/fair.c
parentab71d36ddb9e60d4ddb28a187718815d38c3c666 (diff)
nohz: Rename CONFIG_NO_HZ to CONFIG_NO_HZ_COMMON
We are planning to convert the dynticks Kconfig options layout into a choice menu. The user must be able to easily pick any of the following implementations: constant periodic tick, idle dynticks, full dynticks. As this implies a mutual exclusion, the two dynticks implementions need to converge on the selection of a common Kconfig option in order to ease the sharing of a common infrastructure. It would thus seem pretty natural to reuse CONFIG_NO_HZ to that end. It already implements all the idle dynticks code and the full dynticks depends on all that code for now. So ideally the choice menu would propose CONFIG_NO_HZ_IDLE and CONFIG_NO_HZ_EXTENDED then both would select CONFIG_NO_HZ. On the other hand we want to stay backward compatible: if CONFIG_NO_HZ is set in an older config file, we want to enable CONFIG_NO_HZ_IDLE by default. But we can't afford both at the same time or we run into a circular dependency: 1) CONFIG_NO_HZ_IDLE and CONFIG_NO_HZ_EXTENDED both select CONFIG_NO_HZ 2) If CONFIG_NO_HZ is set, we default to CONFIG_NO_HZ_IDLE We might be able to support that from Kconfig/Kbuild but it may not be wise to introduce such a confusing behaviour. So to solve this, create a new CONFIG_NO_HZ_COMMON option which gathers the common code between idle and full dynticks (that common code for now is simply the idle dynticks code) and select it from their referring Kconfig. Then we'll later create CONFIG_NO_HZ_IDLE and map CONFIG_NO_HZ to it for backward compatibility. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Christoph Lameter <cl@linux.com> Cc: Geoff Levand <geoff@infradead.org> Cc: Gilad Ben Yossef <gilad@benyossef.com> Cc: Hakan Akkan <hakanakkan@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Kevin Hilman <khilman@linaro.org> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 539760ef00c4..5c97fca091a7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5331,7 +5331,7 @@ out_unlock:
5331 return 0; 5331 return 0;
5332} 5332}
5333 5333
5334#ifdef CONFIG_NO_HZ 5334#ifdef CONFIG_NO_HZ_COMMON
5335/* 5335/*
5336 * idle load balancing details 5336 * idle load balancing details
5337 * - When one of the busy CPUs notice that there may be an idle rebalancing 5337 * - When one of the busy CPUs notice that there may be an idle rebalancing
@@ -5541,9 +5541,9 @@ out:
5541 rq->next_balance = next_balance; 5541 rq->next_balance = next_balance;
5542} 5542}
5543 5543
5544#ifdef CONFIG_NO_HZ 5544#ifdef CONFIG_NO_HZ_COMMON
5545/* 5545/*
5546 * In CONFIG_NO_HZ case, the idle balance kickee will do the 5546 * In CONFIG_NO_HZ_COMMON case, the idle balance kickee will do the
5547 * rebalancing for all the cpus for whom scheduler ticks are stopped. 5547 * rebalancing for all the cpus for whom scheduler ticks are stopped.
5548 */ 5548 */
5549static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle) 5549static void nohz_idle_balance(int this_cpu, enum cpu_idle_type idle)
@@ -5686,7 +5686,7 @@ void trigger_load_balance(struct rq *rq, int cpu)
5686 if (time_after_eq(jiffies, rq->next_balance) && 5686 if (time_after_eq(jiffies, rq->next_balance) &&
5687 likely(!on_null_domain(cpu))) 5687 likely(!on_null_domain(cpu)))
5688 raise_softirq(SCHED_SOFTIRQ); 5688 raise_softirq(SCHED_SOFTIRQ);
5689#ifdef CONFIG_NO_HZ 5689#ifdef CONFIG_NO_HZ_COMMON
5690 if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu))) 5690 if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu)))
5691 nohz_balancer_kick(cpu); 5691 nohz_balancer_kick(cpu);
5692#endif 5692#endif
@@ -6156,7 +6156,7 @@ __init void init_sched_fair_class(void)
6156#ifdef CONFIG_SMP 6156#ifdef CONFIG_SMP
6157 open_softirq(SCHED_SOFTIRQ, run_rebalance_domains); 6157 open_softirq(SCHED_SOFTIRQ, run_rebalance_domains);
6158 6158
6159#ifdef CONFIG_NO_HZ 6159#ifdef CONFIG_NO_HZ_COMMON
6160 nohz.next_balance = jiffies; 6160 nohz.next_balance = jiffies;
6161 zalloc_cpumask_var(&nohz.idle_cpus_mask, GFP_NOWAIT); 6161 zalloc_cpumask_var(&nohz.idle_cpus_mask, GFP_NOWAIT);
6162 cpu_notifier(sched_ilb_notifier, 0); 6162 cpu_notifier(sched_ilb_notifier, 0);