Re: Perf: event wakeup discards sched_waking events

From: Steven Rostedt
Date: Mon Jan 14 2019 - 17:04:08 EST


On Mon, 14 Jan 2019 16:36:59 -0500 (EST)
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:

> Can ftrace end up in the same situation through rb_wake_up_waiters() ? I suspect
> the tail recursion would be hard to trigger if the wakeup only happens once per
> page though, unless the events generated end up filling up a page.

And only events from the irq work that was caused by the ftrace wakeup,
which is highly unlikely.

Note, the lastest kernel only wakes up after half the buffer is full
(by default, but that can be changed), as I found that it gives the
best performance to keeping up with traces. I can actually trace small
loads and get all events now. Before, the waking of the tracer would
cause its own events to fill up the buffer and not be able to keep up
even on simple loads.

>
> FWIW, LTTng avoids this entire issue by using a timer-based polling mechanism
> to ensure the tracing code does not call into the scheduler wakeup.

Does your timer stop if the system is idle and tracing is enabled?

-- Steve