diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-07-24 17:52:27 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-08-14 11:14:57 -0400 |
commit | 460775df4680b4593d8449bc171008578625a850 (patch) | |
tree | 9b6adb04b9751c70c05bfa97761bd5f2a5c9d1aa /kernel | |
parent | 73867dcd0792ad14fb31bfe73d09d9a4576f7fc2 (diff) |
nohz: Optimize full dynticks state checks with static keys
These APIs are frequenctly accessed and priority is given
to optimize the full dynticks off-case in order to let
distros enable this feature without suffering from
significant performance regressions.
Let's inline these APIs and optimize them with static keys.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/tick-sched.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index b28dee43e644..0b7887389bd2 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -149,7 +149,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | #ifdef CONFIG_NO_HZ_FULL | 151 | #ifdef CONFIG_NO_HZ_FULL |
152 | static cpumask_var_t tick_nohz_full_mask; | 152 | cpumask_var_t tick_nohz_full_mask; |
153 | bool tick_nohz_full_running; | 153 | bool tick_nohz_full_running; |
154 | 154 | ||
155 | static bool can_stop_full_tick(void) | 155 | static bool can_stop_full_tick(void) |
@@ -270,14 +270,6 @@ out: | |||
270 | local_irq_restore(flags); | 270 | local_irq_restore(flags); |
271 | } | 271 | } |
272 | 272 | ||
273 | int tick_nohz_full_cpu(int cpu) | ||
274 | { | ||
275 | if (!tick_nohz_full_running) | ||
276 | return 0; | ||
277 | |||
278 | return cpumask_test_cpu(cpu, tick_nohz_full_mask); | ||
279 | } | ||
280 | |||
281 | /* Parse the boot-time nohz CPU list from the kernel parameters. */ | 273 | /* Parse the boot-time nohz CPU list from the kernel parameters. */ |
282 | static int __init tick_nohz_full_setup(char *str) | 274 | static int __init tick_nohz_full_setup(char *str) |
283 | { | 275 | { |
@@ -359,8 +351,6 @@ void __init tick_nohz_init(void) | |||
359 | cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), tick_nohz_full_mask); | 351 | cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), tick_nohz_full_mask); |
360 | pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf); | 352 | pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf); |
361 | } | 353 | } |
362 | #else | ||
363 | #define tick_nohz_full_running (0) | ||
364 | #endif | 354 | #endif |
365 | 355 | ||
366 | /* | 356 | /* |
@@ -738,7 +728,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) | |||
738 | return false; | 728 | return false; |
739 | } | 729 | } |
740 | 730 | ||
741 | if (tick_nohz_full_running) { | 731 | if (tick_nohz_full_enabled()) { |
742 | /* | 732 | /* |
743 | * Keep the tick alive to guarantee timekeeping progression | 733 | * Keep the tick alive to guarantee timekeeping progression |
744 | * if there are full dynticks CPUs around | 734 | * if there are full dynticks CPUs around |