diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-04-14 21:08:27 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-02-11 20:03:54 +0000 |
commit | 2c2d6d5f193b96780a287695634a283331426e02 (patch) | |
tree | a492e03cd38d1b90573f8878a95ac4b0d3fec469 /include | |
parent | 68c9d0bf94f81680d91321a510369ca0f7c7f9f8 (diff) | |
download | linux-stable-2c2d6d5f193b96780a287695634a283331426e02.tar.gz |
hrtimer: Get rid of the resolution field in hrtimer_clock_base
commit 398ca17fb54b212cdc9da7ff4a17a35c48dd2103 upstream.
The field has no value because all clock bases have the same
resolution. The resolution only changes when we switch to high
resolution timer mode. We can evaluate that from a single static
variable as well. In the !HIGHRES case its simply a constant.
Export the variable, so we can simplify the usage sites.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20150414203500.645454122@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bwh: Backported to 3.16 as dependency of commit 552263456215
"powerpc: Fix vDSO clock_getres()":
- Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hrtimer.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index bb4ffff31c69bd..5306bac6aee432 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -137,7 +137,6 @@ struct hrtimer_sleeper { * timer to a base on another cpu. * @clockid: clock id for per_cpu support * @active: red black tree root node for the active timers - * @resolution: the resolution of the clock, in nanoseconds * @get_time: function to retrieve the current time of the clock * @softirq_time: the time when running the hrtimer queue in the softirq * @offset: offset of this clock to the monotonic base @@ -147,7 +146,6 @@ struct hrtimer_clock_base { int index; clockid_t clockid; struct timerqueue_head active; - ktime_t resolution; ktime_t (*get_time)(void); ktime_t softirq_time; ktime_t offset; @@ -293,11 +291,15 @@ extern void hrtimer_peek_ahead_timers(void); extern void clock_was_set_delayed(void); +extern unsigned int hrtimer_resolution; + #else # define MONOTONIC_RES_NSEC LOW_RES_NSEC # define KTIME_MONOTONIC_RES KTIME_LOW_RES +#define hrtimer_resolution LOW_RES_NSEC + static inline void hrtimer_peek_ahead_timers(void) { } /* |