lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.18 703/879] tracing/timerlat: Notify IRQ new max latency only if stop tracing is set
    Date
    From: Daniel Bristot de Oliveira <bristot@kernel.org>

    [ Upstream commit aa748949b4e665f473bc5abdc5f66029cb5f5522 ]

    Currently, the notification of a new max latency is sent from
    timerlat's IRQ handler anytime a new max latency is found.

    While this behavior is not wrong, the send IPI overhead itself
    will increase the thread latency and that is not the desired
    effect (tracing overhead).

    Moreover, the thread will notify a new max latency again because
    the thread latency as it is always higher than the IRQ latency
    that woke it up.

    The only case in which it is helpful to notify a new max latency
    from IRQ is when stop tracing (for the IRQ) is set, as in this
    case, the thread will not be dispatched.

    Notify a new max latency from the IRQ handler only if stop tracing is
    set for the IRQ handler.

    Link: https://lkml.kernel.org/r/2c2d9a56c0886c8402ba320de32856cbbb10c2bb.1652175637.git.bristot@kernel.org

    Cc: Juri Lelli <juri.lelli@redhat.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Reported-by: Clark Williams <williams@redhat.com>
    Fixes: a955d7eac177 ("trace: Add timerlat tracer")
    Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    kernel/trace/trace_osnoise.c | 9 +++++----
    1 file changed, 5 insertions(+), 4 deletions(-)

    diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
    index afb92e2f0aea..d8e8167a079f 100644
    --- a/kernel/trace/trace_osnoise.c
    +++ b/kernel/trace/trace_osnoise.c
    @@ -1578,11 +1578,12 @@ static enum hrtimer_restart timerlat_irq(struct hrtimer *timer)

    trace_timerlat_sample(&s);

    - notify_new_max_latency(diff);
    -
    - if (osnoise_data.stop_tracing)
    - if (time_to_us(diff) >= osnoise_data.stop_tracing)
    + if (osnoise_data.stop_tracing) {
    + if (time_to_us(diff) >= osnoise_data.stop_tracing) {
    osnoise_stop_tracing();
    + notify_new_max_latency(diff);
    + }
    + }

    wake_up_process(tlat->kthread);

    --
    2.35.1


    \
     
     \ /
      Last update: 2022-06-08 04:49    [W:2.950 / U:0.940 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site