lkml.org 
[lkml]   [2014]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH -rt] timer: upper bound on loops of __run_timers processing

Commit "timers: do not raise softirq unconditionally", allows for timer
wheel processing (__run_timers) to be delayed for long periods of time.

The effect is that

loops = jiffies - base->timer_jiffies

Can grow to very large values resulting in __run_timers taking hundreds
of milliseconds to execute.

Fix by creating an upper bound on the number of loops to be processed.
This allows a nohz=off kernel to achieve desired latencies.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/kernel/timer.c b/kernel/timer.c
index f59e18c..c128416 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1488,6 +1488,12 @@ void run_local_timers(void)
}
#endif

+ if (time_after_eq(jiffies, base->timer_jiffies)) {
+ unsigned long jiffies_delta = jiffies - base->timer_jiffies;
+ if (jiffies_delta > TVR_SIZE)
+ raise_softirq(TIMER_SOFTIRQ);
+ }
+
if (!base->active_timers)
goto out;


\
 
 \ /
  Last update: 2014-12-30 21:01    [W:0.080 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site