aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <anna-maria@linutronix.de>2017-12-21 05:41:45 -0500
committerIngo Molnar <mingo@kernel.org>2018-01-15 20:35:47 -0500
commiteb27926ba05233dc4f2052cc9d4f19359ec3cd2c (patch)
tree4a71a00143becb669314ce5ace3fd1c06ae04e60 /include/linux/hrtimer.h
parent07a9a7eae86abb796468b225586086d7c4cb59fc (diff)
hrtimer: Make hrtimer_cpu_base.next_timer handling unconditional
hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer in a CPU base. This pointer cannot be dereferenced and is solely used to check whether a hrtimer which is removed is the hrtimer which is the first to expire in the CPU base. If this is the case, then the timer hardware needs to be reprogrammed to avoid an extra interrupt for nothing. Again, this is conditional functionality, but there is no compelling reason to make this conditional. As a preparation, hrtimer_cpu_base.next_timer needs to be available unconditonally. Aside of that the upcoming support for softirq based hrtimers requires access to this pointer unconditionally as well, so our motivation is not entirely simplicity based. Make the update of hrtimer_cpu_base.next_timer unconditional and remove the #ifdef cruft. The impact on CONFIG_HIGH_RES_TIMERS=n && CONFIG_NOHZ=n is marginal as it's just a store on an already dirtied cacheline. No functional change. Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Cc: Christoph Hellwig <hch@lst.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: keescook@chromium.org Link: http://lkml.kernel.org/r/20171221104205.7269-17-anna-maria@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index bb7270e8bc37..2d3e1d678a4d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -164,13 +164,13 @@ enum hrtimer_base_type {
164 * @hres_active: State of high resolution mode 164 * @hres_active: State of high resolution mode
165 * @in_hrtirq: hrtimer_interrupt() is currently executing 165 * @in_hrtirq: hrtimer_interrupt() is currently executing
166 * @hang_detected: The last hrtimer interrupt detected a hang 166 * @hang_detected: The last hrtimer interrupt detected a hang
167 * @next_timer: Pointer to the first expiring timer
168 * @nr_events: Total number of hrtimer interrupt events 167 * @nr_events: Total number of hrtimer interrupt events
169 * @nr_retries: Total number of hrtimer interrupt retries 168 * @nr_retries: Total number of hrtimer interrupt retries
170 * @nr_hangs: Total number of hrtimer interrupt hangs 169 * @nr_hangs: Total number of hrtimer interrupt hangs
171 * @max_hang_time: Maximum time spent in hrtimer_interrupt 170 * @max_hang_time: Maximum time spent in hrtimer_interrupt
172 * @expires_next: absolute time of the next event, is required for remote 171 * @expires_next: absolute time of the next event, is required for remote
173 * hrtimer enqueue 172 * hrtimer enqueue
173 * @next_timer: Pointer to the first expiring timer
174 * @clock_base: array of clock bases for this cpu 174 * @clock_base: array of clock bases for this cpu
175 * 175 *
176 * Note: next_timer is just an optimization for __remove_hrtimer(). 176 * Note: next_timer is just an optimization for __remove_hrtimer().
@@ -186,13 +186,13 @@ struct hrtimer_cpu_base {
186#ifdef CONFIG_HIGH_RES_TIMERS 186#ifdef CONFIG_HIGH_RES_TIMERS
187 unsigned int in_hrtirq : 1, 187 unsigned int in_hrtirq : 1,
188 hang_detected : 1; 188 hang_detected : 1;
189 struct hrtimer *next_timer;
190 unsigned int nr_events; 189 unsigned int nr_events;
191 unsigned short nr_retries; 190 unsigned short nr_retries;
192 unsigned short nr_hangs; 191 unsigned short nr_hangs;
193 unsigned int max_hang_time; 192 unsigned int max_hang_time;
194#endif 193#endif
195 ktime_t expires_next; 194 ktime_t expires_next;
195 struct hrtimer *next_timer;
196 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; 196 struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES];
197} ____cacheline_aligned; 197} ____cacheline_aligned;
198 198