aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
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/time
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/time')
-rw-r--r--kernel/time/Kconfig13
-rw-r--r--kernel/time/tick-sched.c12
2 files changed, 15 insertions, 10 deletions
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 726c33e00da2..c88fc43494c9 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -64,16 +64,21 @@ config GENERIC_CMOS_UPDATE
64if GENERIC_CLOCKEVENTS 64if GENERIC_CLOCKEVENTS
65menu "Timers subsystem" 65menu "Timers subsystem"
66 66
67# Core internal switch. Selected by NO_HZ / HIGH_RES_TIMERS. This is 67# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is
68# only related to the tick functionality. Oneshot clockevent devices 68# only related to the tick functionality. Oneshot clockevent devices
69# are supported independ of this. 69# are supported independ of this.
70config TICK_ONESHOT 70config TICK_ONESHOT
71 bool 71 bool
72 72
73config NO_HZ_COMMON
74 bool
75 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
76 select TICK_ONESHOT
77
73config NO_HZ 78config NO_HZ
74 bool "Tickless System (Dynamic Ticks)" 79 bool "Tickless System (Dynamic Ticks)"
75 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS 80 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
76 select TICK_ONESHOT 81 select NO_HZ_COMMON
77 help 82 help
78 This option enables a tickless system: timer interrupts will 83 This option enables a tickless system: timer interrupts will
79 only trigger on an as-needed basis both when the system is 84 only trigger on an as-needed basis both when the system is
@@ -81,14 +86,14 @@ config NO_HZ
81 86
82config NO_HZ_EXTENDED 87config NO_HZ_EXTENDED
83 bool "Full dynticks system" 88 bool "Full dynticks system"
84 # NO_HZ dependency 89 # NO_HZ_COMMON dependency
85 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS 90 depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
86 # RCU_USER_QS 91 # RCU_USER_QS
87 depends on HAVE_CONTEXT_TRACKING && SMP 92 depends on HAVE_CONTEXT_TRACKING && SMP
88 # RCU_NOCB_CPU dependency 93 # RCU_NOCB_CPU dependency
89 depends on TREE_RCU || TREE_PREEMPT_RCU 94 depends on TREE_RCU || TREE_PREEMPT_RCU
90 depends on VIRT_CPU_ACCOUNTING_GEN 95 depends on VIRT_CPU_ACCOUNTING_GEN
91 select NO_HZ 96 select NO_HZ_COMMON
92 select RCU_USER_QS 97 select RCU_USER_QS
93 select RCU_NOCB_CPU 98 select RCU_NOCB_CPU
94 select CONTEXT_TRACKING_FORCE 99 select CONTEXT_TRACKING_FORCE
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 57bb3fe5aaa3..ccfc2086cd4b 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -104,7 +104,7 @@ static void tick_sched_do_timer(ktime_t now)
104{ 104{
105 int cpu = smp_processor_id(); 105 int cpu = smp_processor_id();
106 106
107#ifdef CONFIG_NO_HZ 107#ifdef CONFIG_NO_HZ_COMMON
108 /* 108 /*
109 * Check if the do_timer duty was dropped. We don't care about 109 * Check if the do_timer duty was dropped. We don't care about
110 * concurrency: This happens only when the cpu in charge went 110 * concurrency: This happens only when the cpu in charge went
@@ -124,7 +124,7 @@ static void tick_sched_do_timer(ktime_t now)
124 124
125static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) 125static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs)
126{ 126{
127#ifdef CONFIG_NO_HZ 127#ifdef CONFIG_NO_HZ_COMMON
128 /* 128 /*
129 * When we are idle and the tick is stopped, we have to touch 129 * When we are idle and the tick is stopped, we have to touch
130 * the watchdog as we might not schedule for a really long 130 * the watchdog as we might not schedule for a really long
@@ -235,7 +235,7 @@ core_initcall(init_tick_nohz_extended);
235/* 235/*
236 * NOHZ - aka dynamic tick functionality 236 * NOHZ - aka dynamic tick functionality
237 */ 237 */
238#ifdef CONFIG_NO_HZ 238#ifdef CONFIG_NO_HZ_COMMON
239/* 239/*
240 * NO HZ enabled ? 240 * NO HZ enabled ?
241 */ 241 */
@@ -907,7 +907,7 @@ static inline void tick_check_nohz(int cpu)
907static inline void tick_nohz_switch_to_nohz(void) { } 907static inline void tick_nohz_switch_to_nohz(void) { }
908static inline void tick_check_nohz(int cpu) { } 908static inline void tick_check_nohz(int cpu) { }
909 909
910#endif /* NO_HZ */ 910#endif /* CONFIG_NO_HZ_COMMON */
911 911
912/* 912/*
913 * Called from irq_enter to notify about the possible interruption of idle() 913 * Called from irq_enter to notify about the possible interruption of idle()
@@ -992,14 +992,14 @@ void tick_setup_sched_timer(void)
992 now = ktime_get(); 992 now = ktime_get();
993 } 993 }
994 994
995#ifdef CONFIG_NO_HZ 995#ifdef CONFIG_NO_HZ_COMMON
996 if (tick_nohz_enabled) 996 if (tick_nohz_enabled)
997 ts->nohz_mode = NOHZ_MODE_HIGHRES; 997 ts->nohz_mode = NOHZ_MODE_HIGHRES;
998#endif 998#endif
999} 999}
1000#endif /* HIGH_RES_TIMERS */ 1000#endif /* HIGH_RES_TIMERS */
1001 1001
1002#if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS 1002#if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS
1003void tick_cancel_sched_timer(int cpu) 1003void tick_cancel_sched_timer(int cpu)
1004{ 1004{
1005 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); 1005 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);