Re: [PATCH 4/6] tracing: Fix waking up tracing readers

2024-03-08 Thread Steven Rostedt
On Fri, 08 Mar 2024 13:38:20 -0500 Steven Rostedt wrote: > +static DEFINE_MUTEX(wait_mutex); > + > +static bool wait_woken_prepare(struct trace_iterator *iter, int *wait_index) > +{ > + bool woken = false; > + > + mutex_lock(_mutex); > + if (iter->waking) > + woken =

[PATCH 4/6] tracing: Fix waking up tracing readers

2024-03-08 Thread Steven Rostedt
From: "Steven Rostedt (Google)" When the tracing_pipe_raw file is closed, if there are readers still blocked on it, they need to be woken up. Currently a wait_index is used. When the readers need to be woken, the index is updated and they are all woken up. But there is a race where a new reader