Re: [PATCH 2/2] tracing: Use proper do_arch_spin_lock() API

From: Peter Zijlstra
Date: Thu Sep 22 2022 - 03:55:44 EST



I'm with Steve on not adding wrappers for this; people that use
arch_spinlock_* get to keep the pieces :-)

On Wed, Sep 21, 2022 at 06:17:21PM -0400, Steven Rostedt wrote:

> > @@ -1819,7 +1819,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu,
> > return;
> > }
> >
> > - arch_spin_lock(&tr->max_lock);
> > + do_arch_spin_lock(&tr->max_lock);
>
> Nothing here is needed, as interrupts had better be disabled when this
> function is called. And there's already a:
>
> WARN_ON_ONCE(!irqs_disabled());

You can write that as lockdep_assert_irqs_disabled();