Re: [PATCH v6 4/4] tracing: Histogram for delayed hrtimer offsets

From: Carsten Emde
Date: Fri Sep 23 2016 - 11:04:07 EST


On 09/09/2016 03:30 PM, Thomas Gleixner wrote:
> On Thu, 8 Sep 2016, Binoy Jayan wrote:
>> On 8 September 2016 at 12:40, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> [..]
>>>> + latency = ktime_to_ns(ktime_sub(basenow,
>>>> + ktime_to_ns(timer->praecox) ?
>>>> + timer->praecox : hrtimer_get_expires(timer)));
>>>> + task = timer->function == hrtimer_wakeup ?
>>>> + container_of(timer, struct hrtimer_sleeper,
>>>> + timer)->task : NULL;
>>>
>>> This is a complete horrible hack. You're tying the task evaluation into a
>>> single instance of hrtimer users. What's the justification for this and why
>>> do you need task at all?
Makes only sense, if any, if wakeup latency histograms that store the task with
the highest latency so far are available. Initially, I wanted to give a short
explanation here why such internal histograms may be useful, but I found it
easier in a format where pictures of example latency plots and recordings can
be shown. So I wrote a short article on "Preemption latency of real-time Linux
systems" -> https://www.osadl.org/Single-View.111+M5246ebc55e3.0.html.

Hope this helps,

-Carsten.