[Intel-gfx] [PATCH 05/12] drm/i915: Protect lockdep functions with #ifdef
Namhyung Kim
namhyung at kernel.org
Wed Feb 9 19:28:50 UTC 2022
Hello,
On Wed, Feb 9, 2022 at 8:27 AM Steven Rostedt <rostedt at goodmis.org> wrote:
>
> On Wed, 09 Feb 2022 15:49:01 +0200
> Jani Nikula <jani.nikula at linux.intel.com> wrote:
>
> > > Because I want to use the lockdep annotation for other purposes.
> > > But the workqueue lockdep_map was defined under LOCKDEP
> > > only. Please see the description in the cover letter.
> > >
> > > https://lore.kernel.org/all/20220208184208.79303-1-namhyung@kernel.org/
> >
> > So lockdep_init_map() might still be there and build just fine for
> > CONFIG_LOCKDEP=n, but now we're actually required to wrap all call sites
> > in #ifdefs depending on the purpose? I'm not convinced yet.
Because work_struct.lockdep_map is there only if CONFIG_LOCKDEP=y.
>
> I addressed this already. I suggested to add a "raw" variant that turns to
> a nop when LOCKDEP is not enabled. That is, for those locations that are
> only for working with LOCKDEP, the call will be:
>
> lockdep_init_map_raw()
>
> This will differentiate the locations that are for just lockdep and those
> that are for both lockdep and tracing.
Yep, this should be fine if it's actually defined on CONFIG_LOCKDEP=y.
Thanks,
Namhyung
More information about the Intel-gfx
mailing list