[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-3ec7a3ee9f15f6dcac1591902d85b94c2a4b520d@git.kernel.org>
Date: Mon, 15 Jan 2018 19:49:32 -0800
From: tip-bot for Anna-Maria Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, peterz@...radead.org, tglx@...utronix.de,
hch@....de, anna-maria@...utronix.de,
torvalds@...ux-foundation.org, john.stultz@...aro.org,
linux-kernel@...r.kernel.org, hpa@...or.com
Subject: [tip:timers/core] hrtimer: Remove the 'base' parameter from
hrtimer_reprogram()
Commit-ID: 3ec7a3ee9f15f6dcac1591902d85b94c2a4b520d
Gitweb: https://git.kernel.org/tip/3ec7a3ee9f15f6dcac1591902d85b94c2a4b520d
Author: Anna-Maria Gleixner <anna-maria@...utronix.de>
AuthorDate: Thu, 21 Dec 2017 11:41:51 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 16 Jan 2018 02:53:59 +0100
hrtimer: Remove the 'base' parameter from hrtimer_reprogram()
hrtimer_reprogram() must have access to the hrtimer_clock_base of the new
first expiring timer to access hrtimer_clock_base.offset for adjusting the
expiry time to CLOCK_MONOTONIC. This is required to evaluate whether the
new left most timer in the hrtimer_clock_base is the first expiring timer
of all clock bases in a hrtimer_cpu_base.
The only user of hrtimer_reprogram() is hrtimer_start_range_ns(), which has
a pointer to hrtimer_clock_base() already and hands it in as a parameter. But
hrtimer_start_range_ns() will be split for the upcoming support for softirq
based hrtimers to avoid code duplication and will lose the direct access to
the clock base pointer.
Instead of handing in timer and timer->base as a parameter remove the base
parameter from hrtimer_reprogram() instead and retrieve the clock base internally.
Signed-off-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
Cc: Christoph Hellwig <hch@....de>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: keescook@...omium.org
Link: http://lkml.kernel.org/r/20171221104205.7269-23-anna-maria@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/time/hrtimer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index f4a56fb..33a6c99 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -648,10 +648,10 @@ static inline void retrigger_next_event(void *arg) { }
*
* Called with interrupts disabled and base->cpu_base.lock held
*/
-static void hrtimer_reprogram(struct hrtimer *timer,
- struct hrtimer_clock_base *base)
+static void hrtimer_reprogram(struct hrtimer *timer)
{
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
+ struct hrtimer_clock_base *base = timer->base;
ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0);
@@ -939,7 +939,7 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
if (!leftmost)
goto unlock;
- hrtimer_reprogram(timer, new_base);
+ hrtimer_reprogram(timer);
unlock:
unlock_hrtimer_base(timer, &flags);
}
Powered by blists - more mailing lists