Skip to contentSkip to conversation

timer fixes for 3.2

GIT PULL Thomas Gleixner 1 participant 1 message Nov 28, 2011 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest timers-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus

Thanks,

tglx

------------------>
Hector Palacios (1):
timekeeping: add arch_offset hook to ktime_get functions

Jeff Ohlstein (1):
hrtimer: Fix extra wakeups from __remove_hrtimer()

John Stultz (2):
time: Improve documentation of timekeeeping_adjust()
clocksource: Avoid selecting mult values that might overflow when adjusted

 include/linux/clocksource.h |    3 +-
 kernel/hrtimer.c            |    6 ++-
 kernel/time/clocksource.c   |   58 ++++++++++++++++++++++-----
 kernel/time/timekeeping.c   |   92 ++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 145 insertions(+), 14 deletions(-)
include/linux/clocksource.h +2 -1
index 139c4db..c86c940 100644
@@ -156,6 +156,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
  * @mult:		cycle to nanosecond multiplier
  * @shift:		cycle to nanosecond divisor (power of two)
  * @max_idle_ns:	max idle time permitted by the clocksource (nsecs)
+ * @maxadj		maximum adjustment value to mult (~11%)
  * @flags:		flags describing special properties
  * @archdata:		arch-specific data
  * @suspend:		suspend function for the clocksource, if necessary
@@ -172,7 +173,7 @@ struct clocksource {
 	u32 mult;
 	u32 shift;
 	u64 max_idle_ns;
-
+	u32 maxadj;
 #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
 	struct arch_clocksource_data archdata;
 #endif
kernel/hrtimer.c +4 -2
index a9205e3..2043c08 100644
@@ -885,10 +885,13 @@ static void __remove_hrtimer(struct hrtimer *timer,
 			     struct hrtimer_clock_base *base,
 			     unsigned long newstate, int reprogram)
 {
+	struct timerqueue_node *next_timer;
 	if (!(timer->state & HRTIMER_STATE_ENQUEUED))
 		goto out;
 
-	if (&timer->node == timerqueue_getnext(&base->active)) {
+	next_timer = timerqueue_getnext(&base->active);
+	timerqueue_del(&base->active, &timer->node);
+	if (&timer->node == next_timer) {
 #ifdef CONFIG_HIGH_RES_TIMERS
 		/* Reprogram the clock event device. if enabled */
 		if (reprogram && hrtimer_hres_active()) {
@@ -901,7 +904,6 @@ static void __remove_hrtimer(struct hrtimer *timer,
 		}
 #endif
 	}
-	timerqueue_del(&base->active, &timer->node);
 	if (!timerqueue_getnext(&base->active))
 		base->cpu_base->active_bases &= ~(1 << base->index);
 out:
kernel/time/clocksource.c +48 -10

98 lines not on this page · raw message

kernel/time/timekeeping.c +91 -1

126 lines not on this page · raw message