[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210308214208.42a5577f@yea>
Date: Mon, 8 Mar 2021 21:42:08 +0100
From: "Erhard F." <erhard_f@...lbox.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Ahmed S. Darwish" <a.darwish@...utronix.de>,
Jakub Kicinski <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Subject: Re: seqlock lockdep false positives?
On Mon, 8 Mar 2021 09:38:11 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> Indeed, that's one area where inlines are very much not equivalent to
> macros. Static variables in inline functions aren't exact, but they very
> much do not get to be one per invocation.
>
> Something like the below ought to be the right fix I think.
>
> diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
> index c6abb79501b3..e81856c0ba13 100644
> --- a/include/linux/u64_stats_sync.h
> +++ b/include/linux/u64_stats_sync.h
> @@ -115,12 +115,13 @@ static inline void u64_stats_inc(u64_stats_t *p)
> }
> #endif
>
> +#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
> +#define u64_stats_init(syncp) seqcount_init(&(syncp)->seq)
> +#else
> static inline void u64_stats_init(struct u64_stats_sync *syncp)
> {
> -#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
> - seqcount_init(&syncp->seq);
> -#endif
> }
> +#endif
>
> static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
> {
Hi Peter!
I can confirm that your patch on top of 5.12-rc2 makes the lockdep splat disappear (Ahmeds' 1st patch not installed).
Powered by blists - more mailing lists