Skip to content

Commit 127bfa5

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
hrtimer: Unify MONOTONIC and BOOTTIME clock behavior
Now that th MONOTONIC and BOOTTIME clocks are indentical remove all the special casing. The user space visible interfaces still support both clocks, but their behavior is identical. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kevin Easton <kevin@guarana.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20180301165150.410218515@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 7250a40 commit 127bfa5

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

include/linux/hrtimer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,9 @@ struct hrtimer_clock_base {
161161
enum hrtimer_base_type {
162162
HRTIMER_BASE_MONOTONIC,
163163
HRTIMER_BASE_REALTIME,
164-
HRTIMER_BASE_BOOTTIME,
165164
HRTIMER_BASE_TAI,
166165
HRTIMER_BASE_MONOTONIC_SOFT,
167166
HRTIMER_BASE_REALTIME_SOFT,
168-
HRTIMER_BASE_BOOTTIME_SOFT,
169167
HRTIMER_BASE_TAI_SOFT,
170168
HRTIMER_MAX_CLOCK_BASES,
171169
};

kernel/time/hrtimer.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
9090
.clockid = CLOCK_REALTIME,
9191
.get_time = &ktime_get_real,
9292
},
93-
{
94-
.index = HRTIMER_BASE_BOOTTIME,
95-
.clockid = CLOCK_BOOTTIME,
96-
.get_time = &ktime_get_boottime,
97-
},
9893
{
9994
.index = HRTIMER_BASE_TAI,
10095
.clockid = CLOCK_TAI,
@@ -110,11 +105,6 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
110105
.clockid = CLOCK_REALTIME,
111106
.get_time = &ktime_get_real,
112107
},
113-
{
114-
.index = HRTIMER_BASE_BOOTTIME_SOFT,
115-
.clockid = CLOCK_BOOTTIME,
116-
.get_time = &ktime_get_boottime,
117-
},
118108
{
119109
.index = HRTIMER_BASE_TAI_SOFT,
120110
.clockid = CLOCK_TAI,
@@ -129,7 +119,7 @@ static const int hrtimer_clock_to_base_table[MAX_CLOCKS] = {
129119

130120
[CLOCK_REALTIME] = HRTIMER_BASE_REALTIME,
131121
[CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC,
132-
[CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME,
122+
[CLOCK_BOOTTIME] = HRTIMER_BASE_MONOTONIC,
133123
[CLOCK_TAI] = HRTIMER_BASE_TAI,
134124
};
135125

@@ -565,14 +555,12 @@ __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base, unsigned int active_
565555
static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
566556
{
567557
ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset;
568-
ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset;
569558
ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset;
570559

571560
ktime_t now = ktime_get_update_offsets_now(&base->clock_was_set_seq,
572-
offs_real, offs_boot, offs_tai);
561+
offs_real, offs_tai);
573562

574563
base->clock_base[HRTIMER_BASE_REALTIME_SOFT].offset = *offs_real;
575-
base->clock_base[HRTIMER_BASE_BOOTTIME_SOFT].offset = *offs_boot;
576564
base->clock_base[HRTIMER_BASE_TAI_SOFT].offset = *offs_tai;
577565

578566
return now;

kernel/time/timekeeping.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,6 @@ void do_timer(unsigned long ticks)
21952195
* ktime_get_update_offsets_now - hrtimer helper
21962196
* @cwsseq: pointer to check and store the clock was set sequence number
21972197
* @offs_real: pointer to storage for monotonic -> realtime offset
2198-
* @offs_boot: pointer to storage for monotonic -> boottime offset
21992198
* @offs_tai: pointer to storage for monotonic -> clock tai offset
22002199
*
22012200
* Returns current monotonic time and updates the offsets if the
@@ -2205,7 +2204,7 @@ void do_timer(unsigned long ticks)
22052204
* Called from hrtimer_interrupt() or retrigger_next_event()
22062205
*/
22072206
ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
2208-
ktime_t *offs_boot, ktime_t *offs_tai)
2207+
ktime_t *offs_tai)
22092208
{
22102209
struct timekeeper *tk = &tk_core.timekeeper;
22112210
unsigned int seq;
@@ -2222,7 +2221,6 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
22222221
if (*cwsseq != tk->clock_was_set_seq) {
22232222
*cwsseq = tk->clock_was_set_seq;
22242223
*offs_real = tk->offs_real;
2225-
*offs_boot = tk->offs_boot;
22262224
*offs_tai = tk->offs_tai;
22272225
}
22282226

kernel/time/timekeeping.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
extern ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq,
88
ktime_t *offs_real,
9-
ktime_t *offs_boot,
109
ktime_t *offs_tai);
1110

1211
extern int timekeeping_valid_for_hres(void);

0 commit comments

Comments
 (0)