Re: [RFC][PATCH 3/3] lockdep,trace: Expose tracepoints

From: Steven Rostedt
Date: Fri Aug 07 2020 - 16:34:27 EST


On Fri, 07 Aug 2020 21:23:39 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> The lockdep tracepoints are under the lockdep recursion counter, this
> has a bunch of nasty side effects:
>
> - TRACE_IRQFLAGS doesn't work across the entire tracepoint, leading to
> all sorts of dodgy complaints.
>
> - RCU-lockdep doesn't see the tracepoints either, hiding numerous
> "suspicious RCU usage" warnings.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> ---
> kernel/locking/lockdep.c | 27 ++++++++++++++++++---------
> 1 file changed, 18 insertions(+), 9 deletions(-)
>
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -5000,8 +5000,9 @@ void lock_acquire(struct lockdep_map *lo
> raw_local_irq_save(flags);
> check_flags(flags);
>
> - current->lockdep_recursion++;
> trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip);
> +
> + current->lockdep_recursion++;
> __lock_acquire(lock, subclass, trylock, read, check,
> irqs_disabled_flags(flags), nest_lock, ip, 0, 0);
> lockdep_recursion_finish();
> @@ -5016,10 +5017,13 @@ void lock_release(struct lockdep_map *lo
> if (unlikely(current->lockdep_recursion))
> return;
>
> +

Superfluous space.


Other than that:

Reviewed-by: Steven Rosted (VMware) <rostedt@xxxxxxxxxxx>

-- Steve

> raw_local_irq_save(flags);
> check_flags(flags);
> - current->lockdep_recursion++;
> +
> trace_lock_release(lock, ip);
> +
> + current->lockdep_recursion++;
> if (__lock_release(lock, ip))
> check_chain_key(current);
> lockdep_recursion_finish();
> @@ -5171,7 +5175,7 @@ __lock_contended(struct lockdep_map *loc
> stats->bounces[bounce_contended + !!hlock->read]++;
> }
>