Re: [PATCH 1/1] u64_stats: fix u64_stats_init() for lockdep when used repeatedly in one file

From: Eric Dumazet
Date: Mon Mar 11 2024 - 13:44:25 EST


On Mon, Mar 11, 2024 at 6:25 PM Petr Tesařík <petr@xxxxxxxxxxx> wrote:
>
> On Wed, 6 Mar 2024 12:11:57 +0100
> Petr Tesarik <petr@xxxxxxxxxxx> wrote:
>
> > Fix bogus lockdep warnings if multiple u64_stats_sync variables are
> > initialized in the same file.
> >
> > With CONFIG_LOCKDEP, seqcount_init() is a macro which declares:
> >
> > static struct lock_class_key __key;
> >
> > Since u64_stats_init() is a function (albeit an inline one), all calls
> > within the same file end up using the same instance, effectively treating
> > them all as a single lock-class.
>
> What happens with this fix now?
>
> IIUC it should be reviewed by Eric, but I don't know through which tree
> it should be merged. Any plans yet?

I thought I gave a reply, but apparently not .

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>

Thanks.