summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-07-24 23:52:27 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2013-08-14 17:14:57 +0200
commit460775df4680b4593d8449bc171008578625a850 (patch)
tree9b6adb04b9751c70c05bfa97761bd5f2a5c9d1aa /kernel/time
parent73867dcd0792ad14fb31bfe73d09d9a4576f7fc2 (diff)
downloadlinux-460775df4680b4593d8449bc171008578625a850.tar.gz
linux-460775df4680b4593d8449bc171008578625a850.tar.bz2
linux-460775df4680b4593d8449bc171008578625a850.zip
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/time')
-rw-r--r--kernel/time/tick-sched.c14
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)
}
#ifdef CONFIG_NO_HZ_FULL
-static cpumask_var_t tick_nohz_full_mask;
+cpumask_var_t tick_nohz_full_mask;
bool tick_nohz_full_running;
static bool can_stop_full_tick(void)
@@ -270,14 +270,6 @@ out:
local_irq_restore(flags);
}
-int tick_nohz_full_cpu(int cpu)
-{
- if (!tick_nohz_full_running)
- return 0;
-
- return cpumask_test_cpu(cpu, tick_nohz_full_mask);
-}
-
/* Parse the boot-time nohz CPU list from the kernel parameters. */
static int __init tick_nohz_full_setup(char *str)
{
@@ -359,8 +351,6 @@ void __init tick_nohz_init(void)
cpulist_scnprintf(nohz_full_buf, sizeof(nohz_full_buf), tick_nohz_full_mask);
pr_info("NO_HZ: Full dynticks CPUs: %s.\n", nohz_full_buf);
}
-#else
-#define tick_nohz_full_running (0)
#endif
/*
@@ -738,7 +728,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
return false;
}
- if (tick_nohz_full_running) {
+ if (tick_nohz_full_enabled()) {
/*
* Keep the tick alive to guarantee timekeeping progression
* if there are full dynticks CPUs around