lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6.0 160/862] tracing: Wake up waiters when tracing is disabled
    Date
    From: Steven Rostedt (Google) <rostedt@goodmis.org>

    commit 2b0fd9a59b7990c161fa1cb7b79edb22847c87c2 upstream.

    When tracing is disabled, there's no reason that waiters should stay
    waiting, wake them up, otherwise tasks get stuck when they should be
    flushing the buffers.

    Cc: stable@vger.kernel.org
    Fixes: e30f53aad2202 ("tracing: Do not busy wait in buffer splice")
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    kernel/trace/trace.c | 6 ++++++
    1 file changed, 6 insertions(+)

    --- a/kernel/trace/trace.c
    +++ b/kernel/trace/trace.c
    @@ -8334,6 +8334,10 @@ tracing_buffers_splice_read(struct file
    if (ret)
    goto out;

    + /* No need to wait after waking up when tracing is off */
    + if (!tracer_tracing_is_on(iter->tr))
    + goto out;
    +
    /* Make sure we see the new wait_index */
    smp_rmb();
    if (wait_index != iter->wait_index)
    @@ -9043,6 +9047,8 @@ rb_simple_write(struct file *filp, const
    tracer_tracing_off(tr);
    if (tr->current_trace->stop)
    tr->current_trace->stop(tr);
    + /* Wake up any waiters */
    + ring_buffer_wake_waiters(buffer, RING_BUFFER_ALL_CPUS);
    }
    mutex_unlock(&trace_types_lock);
    }

    \
     
     \ /
      Last update: 2022-10-19 10:59    [W:4.031 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site