Re: [PATCH] timer: silenct a lockdep splat with debugobjects

From: Qian Cai
Date: Fri Mar 13 2020 - 17:01:14 EST




> On Mar 13, 2020, at 4:13 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Fri, Mar 13, 2020 at 03:32:52PM -0400, Qian Cai wrote:
>> Well, in mm/vmstat.c (init_mm_internals) case for example, it was initialized
>> as a static,
>>
>> static DECLARE_DEFERRABLE_WORK(shepherd, vmstat_shepherd);
>>
>> which will not call __debug_object_init().
>
> Then fix that.
>
> That is, all of:
>
> DECLARE_DEFERRABLE_WORK
> KTHREAD_DELAYED_WORK_INIT
> DEFINE_TIMER
>
> are broken and need to go.

This looks invasive with so many callsites...

>
> Unless of course, you can frob debugobjects such that we can provide the
> required storage through is_static_object() and modify the above static
> declarators to provide the storage.

Iâll explore this which looks more promising.

>
> Or, fix that random crud to do the wakeup outside of the lock.

That is likely to be difficult until we can find a creative way to not âuglifying" the
random code by dropping locks in the middle etc just because of debugojects.

>
> Plenty options..