Re: [PATCH RT] time/hrtimer: Use softirq based wakeups for non-RT threads

From: Gratian Crisan
Date: Thu Oct 05 2017 - 17:15:51 EST



Sebastian Andrzej Siewior writes:

> Normal wake ups (like clock_nanosleep()) which are performed by normal
> users can easily lead to 2ms latency spikes if (enough) hrtimer wakeups
> are synchronized.
> This patch moves all hrtimers wakeups to the softirq queue unless the
> caller has a RT priority.
>
> Reported-by: Gratian Crisan <gratian.crisan@xxxxxx>

I can confirm this patch fixes the original problem reported.

I ran an overnight test (about 30 hours total) on two platforms using
cyclictest + hrtimer stress load: configurable number of SCHED_OTHER
threads doing random clock_nanosleep() in up to 1 mS intervals.

Without this patch the max latency recorded was:
* on dual core, Intel Atom E3825 @ 1.33GHz: 107 uS
* on dual core, Zynq 7020 @ 667MHz: 261 uS

With this patch the max numbers drop to:
* on dual core, Intel Atom E3825 @ 1.33GHz: 66 uS
* on dual core, Zynq 7020 @ 667MHz: 90 uS

The max latency numbers with this patch are in-line with expectations
for these platforms.

Thank you so much,
-Gratian