From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035124AbcIWPEE (ORCPT ); Fri, 23 Sep 2016 11:04:04 -0400 Received: from toro.web-alm.net ([62.245.132.31]:47589 "EHLO toro.web-alm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034887AbcIWPEC (ORCPT ); Fri, 23 Sep 2016 11:04:02 -0400 X-Greylist: delayed 2012 seconds by postgrey-1.27 at vger.kernel.org; Fri, 23 Sep 2016 11:04:01 EDT Subject: Re: [PATCH v6 4/4] tracing: Histogram for delayed hrtimer offsets To: Linux kernel mailing list References: <1473246835-30075-1-git-send-email-binoy.jayan@linaro.org> <1473246835-30075-5-git-send-email-binoy.jayan@linaro.org> Cc: Thomas Gleixner , Binoy Jayan , "Steven Rostedt (Red Hat)" , Ingo Molnar , Daniel Wagner , Arnd Bergmann , Masami From: Carsten Emde Organization: Open Source Automation Development Lab (OSADL) Message-ID: <4877f67c-bd18-1811-2932-1c2fda47c0e4@osadl.org> Date: Fri, 23 Sep 2016 16:20:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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.