aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index f44e499e8fca..80666f6cd4f9 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -128,15 +128,20 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);
128static void hrtimer_get_softirq_time(struct hrtimer_base *base) 128static void hrtimer_get_softirq_time(struct hrtimer_base *base)
129{ 129{
130 ktime_t xtim, tomono; 130 ktime_t xtim, tomono;
131 struct timespec xts;
131 unsigned long seq; 132 unsigned long seq;
132 133
133 do { 134 do {
134 seq = read_seqbegin(&xtime_lock); 135 seq = read_seqbegin(&xtime_lock);
135 xtim = timespec_to_ktime(xtime); 136#ifdef CONFIG_NO_HZ
136 tomono = timespec_to_ktime(wall_to_monotonic); 137 getnstimeofday(&xts);
137 138#else
139 xts = xtime;
140#endif
138 } while (read_seqretry(&xtime_lock, seq)); 141 } while (read_seqretry(&xtime_lock, seq));
139 142
143 xtim = timespec_to_ktime(xts);
144 tomono = timespec_to_ktime(wall_to_monotonic);
140 base[CLOCK_REALTIME].softirq_time = xtim; 145 base[CLOCK_REALTIME].softirq_time = xtim;
141 base[CLOCK_MONOTONIC].softirq_time = ktime_add(xtim, tomono); 146 base[CLOCK_MONOTONIC].softirq_time = ktime_add(xtim, tomono);
142} 147}