Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Viktor Rosendahl
On 9/4/19 1:39 PM, Steven Rostedt wrote: On Tue, 3 Sep 2019 15:25:59 +0200 Viktor Rosendahl wrote: +void latency_fsnotify_stop(void) +{ + /* Make sure all CPUs see caller's previous actions to stop tracer */ + smp_wmb(); These memory barriers just look wrong. What exactly are

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Viktor Rosendahl
On 9/4/19 10:19 AM, Peter Zijlstra wrote: Adding Paul since RCU faces similar situations, i.e. raising softirq risks scheduler deadlock in rcu_read_unlock_special() -- but RCU's solution is to avoid raising the softirq and instead use irq_work. Which is right. Thanks Joel and Peter for

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Joel Fernandes
On Wed, Sep 04, 2019 at 10:19:19AM +0200, Peter Zijlstra wrote: > On Wed, Sep 04, 2019 at 12:00:39AM -0400, Joel Fernandes wrote: > > [ Resending since I messed up my last email's headers! ] > > > > On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > > > This patch implements the

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Steven Rostedt
On Tue, 3 Sep 2019 15:25:59 +0200 Viktor Rosendahl wrote: > +void latency_fsnotify_stop(void) > +{ > + /* Make sure all CPUs see caller's previous actions to stop tracer */ > + smp_wmb(); These memory barriers just look wrong. What exactly are you trying to protect here? Where's the

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Steven Rostedt
On Wed, 4 Sep 2019 10:20:46 +0200 Peter Zijlstra wrote: > On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > > > It seems like it would be possible to simply replace the calls to > > latency_fsnotify_enable/disable() with calls to > > start/stop_critical_timings(). However, the

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Paul E. McKenney
On Wed, Sep 04, 2019 at 12:00:39AM -0400, Joel Fernandes wrote: > [ Resending since I messed up my last email's headers! ] > > On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > > This patch implements the feature that the tracing_max_latency file, > > e.g.

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Peter Zijlstra
On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > It seems like it would be possible to simply replace the calls to > latency_fsnotify_enable/disable() with calls to > start/stop_critical_timings(). However, the main problem is that it > would not work for the wakup tracer. The

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-04 Thread Peter Zijlstra
On Wed, Sep 04, 2019 at 12:00:39AM -0400, Joel Fernandes wrote: > [ Resending since I messed up my last email's headers! ] > > On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > > This patch implements the feature that the tracing_max_latency file, > > e.g.

Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-03 Thread Joel Fernandes
[ Resending since I messed up my last email's headers! ] On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > This patch implements the feature that the tracing_max_latency file, > e.g. /sys/kernel/debug/tracing/tracing_max_latency will receive > notifications through the fsnotify

[PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency

2019-09-03 Thread Viktor Rosendahl
This patch implements the feature that the tracing_max_latency file, e.g. /sys/kernel/debug/tracing/tracing_max_latency will receive notifications through the fsnotify framework when a new latency is available. One particularly interesting use of this facility is when enabling threshold tracing,