summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunhong Jiang <yunhong.jiang@intel.com>2016-07-22 22:01:15 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-07-22 22:01:15 +0000
commit4f603f6fd3b35451c1bb3f5a2b0b6b05da8d5dc8 (patch)
treeaa8828bc8159149f50c7cc302d557641ee956aba
parentd1db94c2f5f41d450094b67459a2821154e063bc (diff)
parentfafab8722263f4ab08894e35f4385febbce09dd1 (diff)
Merge "Restore the non_hz_full"
-rw-r--r--kernel/kernel/time/timer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/kernel/time/timer.c b/kernel/kernel/time/timer.c
index 76a301b24..016a0bf52 100644
--- a/kernel/kernel/time/timer.c
+++ b/kernel/kernel/time/timer.c
@@ -1453,9 +1453,11 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
* the base lock to check when the next timer is pending and so
* we assume the next jiffy.
*/
- return basem + TICK_NSEC;
-#endif
+ if (!spin_do_trylock(&base->lock))
+ return basem + TICK_NSEC;
+#else
spin_lock(&base->lock);
+#endif
if (base->active_timers) {
if (time_before_eq(base->next_timer, base->timer_jiffies))
base->next_timer = __next_timer_interrupt(base);
@@ -1465,7 +1467,11 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem)
else
expires = basem + (nextevt - basej) * TICK_NSEC;
}
+#ifdef CONFIG_PREEMPT_RT_FULL
+ rt_spin_unlock(&base->lock);
+#else
spin_unlock(&base->lock);
+#endif
return cmp_next_hrtimer_event(basem, expires);
}