alistair23-linux/kernel/time
Thomas Gleixner 683be13a28 timer: Minimize nohz off overhead
If nohz is disabled on the kernel command line the [hr]timer code
still calls wake_up_nohz_cpu() and tick_nohz_full_cpu(), a pretty
pointless exercise. Cache nohz_active in [hr]timer per cpu bases and
avoid the overhead.

Before:
  48.10%  hog       [.] main
  15.25%  [kernel]  [k] _raw_spin_lock_irqsave
   9.76%  [kernel]  [k] _raw_spin_unlock_irqrestore
   6.50%  [kernel]  [k] mod_timer
   6.44%  [kernel]  [k] lock_timer_base.isra.38
   3.87%  [kernel]  [k] detach_if_pending
   3.80%  [kernel]  [k] del_timer
   2.67%  [kernel]  [k] internal_add_timer
   1.33%  [kernel]  [k] __internal_add_timer
   0.73%  [kernel]  [k] timerfn
   0.54%  [kernel]  [k] wake_up_nohz_cpu

After:
  48.73%  hog       [.] main
  15.36%  [kernel]  [k] _raw_spin_lock_irqsave
   9.77%  [kernel]  [k] _raw_spin_unlock_irqrestore
   6.61%  [kernel]  [k] lock_timer_base.isra.38
   6.42%  [kernel]  [k] mod_timer
   3.90%  [kernel]  [k] detach_if_pending
   3.76%  [kernel]  [k] del_timer
   2.41%  [kernel]  [k] internal_add_timer
   1.39%  [kernel]  [k] __internal_add_timer
   0.76%  [kernel]  [k] timerfn

We probably should have a cached value for nohz full in the per cpu
bases as well to avoid the cpumask check. The base cache line is hot
already, the cpumask not necessarily.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Joonwoo Park <joonwoop@codeaurora.org>
Cc: Wenbo Wang <wenbo.wang@memblaze.com>
Link: http://lkml.kernel.org/r/20150526224512.207378134@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-06-19 15:18:28 +02:00
..
alarmtimer.c alarmtimer: Get rid of unused return value 2015-04-22 17:06:52 +02:00
clockevents.c clockevents: Check state instead of mode in suspend/resume path 2015-06-18 09:27:02 +02:00
clocksource.c clocksource: Use current logging style 2015-06-10 11:31:14 +02:00
hrtimer.c timer: Minimize nohz off overhead 2015-06-19 15:18:28 +02:00
itimer.c
jiffies.c tick: Move clocksource related stuff to timekeeping.h 2015-04-01 14:22:58 +02:00
Kconfig clockevents: Remove CONFIG_GENERIC_CLOCKEVENTS_BUILD 2015-04-01 14:22:57 +02:00
Makefile time: Move timeconst.h into include/generated 2015-05-19 15:13:45 +02:00
ntp.c ntp: Do leapsecond adjustment in adjtimex read path 2015-06-12 11:15:49 +02:00
ntp_internal.h time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge 2015-06-12 11:15:49 +02:00
posix-clock.c
posix-cpu-timers.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
posix-timers.c hrtimer: Get rid of hrtimer_get_res() 2015-04-22 17:06:49 +02:00
sched_clock.c timers, sched/clock: Clean up the code a bit 2015-03-27 08:34:01 +01:00
test_udelay.c time: Rename udelay_test.c to test_udelay.c 2014-11-21 11:59:55 -08:00
tick-broadcast-hrtimer.c tick: hrtimer-broadcast: Prevent endless restarting when broadcast device is unused 2015-05-05 15:34:21 +02:00
tick-broadcast.c clockevents: Provide functions to set and get the state 2015-06-02 14:40:47 +02:00
tick-common.c clockevents: Use set/get state helper functions 2015-06-02 14:40:48 +02:00
tick-internal.h timer: Minimize nohz off overhead 2015-06-19 15:18:28 +02:00
tick-oneshot.c clockevents: Provide functions to set and get the state 2015-06-02 14:40:47 +02:00
tick-sched.c timer: Minimize nohz off overhead 2015-06-19 15:18:28 +02:00
tick-sched.h tick: Nohz: Rework next timer evaluation 2015-04-22 17:06:50 +02:00
time.c time: Refactor usecs_to_jiffies 2015-06-10 11:31:13 +02:00
timeconst.bc time: Move timeconst.h into include/generated 2015-05-19 15:13:45 +02:00
timeconv.c
timecounter.c timecounter: keep track of accumulated fractional nanoseconds 2014-12-30 18:29:27 -05:00
timekeeping.c timekeeping: Copy the shadow-timekeeper over the real timekeeper last 2015-06-18 09:27:02 +02:00
timekeeping.h hrtimer: Make offset update smarter 2015-04-22 17:06:49 +02:00
timekeeping_debug.c
timekeeping_internal.h
timer.c timer: Minimize nohz off overhead 2015-06-19 15:18:28 +02:00
timer_list.c timer: Reduce timer migration overhead if disabled 2015-06-19 15:18:28 +02:00
timer_stats.c timer: Stats: Simplify the flags handling 2015-06-19 15:18:27 +02:00