netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Erhard F." <erhard_f@mailbox.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>,
	Jakub Kicinski <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: seqlock lockdep false positives?
Date: Mon, 8 Mar 2021 21:42:08 +0100	[thread overview]
Message-ID: <20210308214208.42a5577f@yea> (raw)
In-Reply-To: <YEXicy6+9MksdLZh@hirez.programming.kicks-ass.net>

On Mon, 8 Mar 2021 09:38:11 +0100
Peter Zijlstra <peterz@infradead.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).

  reply	other threads:[~2021-03-08 20:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  0:40 seqlock lockdep false positives? Jakub Kicinski
2021-03-07  9:20 ` Ahmed S. Darwish
2021-03-08  8:38   ` Peter Zijlstra
2021-03-08 20:42     ` Erhard F. [this message]
2021-03-09  7:54       ` Peter Zijlstra
2021-03-09 10:12         ` Eric Dumazet
2021-03-09 14:24           ` Peter Zijlstra
2021-03-08 18:28   ` Erhard F.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210308214208.42a5577f@yea \
    --to=erhard_f@mailbox.org \
    --cc=a.darwish@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).