]> Git Repo - linux.git/commitdiff
hrtimer: Fix incorrect tai offset calculation for non high-res timer systems
authorJohn Stultz <[email protected]>
Thu, 5 Feb 2015 00:45:26 +0000 (16:45 -0800)
committerIngo Molnar <[email protected]>
Thu, 5 Feb 2015 07:39:37 +0000 (08:39 +0100)
I noticed some CLOCK_TAI timer test failures on one of my
less-frequently used configurations. And after digging in I
found in 76f4108892d9 (Cleanup hrtimer accessors to the
timekepeing state), the hrtimer_get_softirq_time tai offset
calucation was incorrectly rewritten, as the tai offset we
return shold be from CLOCK_MONOTONIC, and not CLOCK_REALTIME.

This results in CLOCK_TAI timers expiring early on non-highres
capable machines.

This patch fixes the issue, calculating the tai time properly
from the monotonic base.

Signed-off-by: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: stable <[email protected]> # 3.17+
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/time/hrtimer.c

index 37e50aadd471195bebb3dc32c9ad026dbbcf2ab7..d8c724cda37b3db78983661a3f93e95195f6fd7c 100644 (file)
@@ -122,7 +122,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
        mono = ktime_get_update_offsets_tick(&off_real, &off_boot, &off_tai);
        boot = ktime_add(mono, off_boot);
        xtim = ktime_add(mono, off_real);
-       tai = ktime_add(xtim, off_tai);
+       tai = ktime_add(mono, off_tai);
 
        base->clock_base[HRTIMER_BASE_REALTIME].softirq_time = xtim;
        base->clock_base[HRTIMER_BASE_MONOTONIC].softirq_time = mono;
This page took 0.059325 seconds and 4 git commands to generate.