From: Peter Zijlstra <peterz@infradead.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Erhard F." <erhard_f@mailbox.org>,
"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: Tue, 9 Mar 2021 15:24:17 +0100 [thread overview]
Message-ID: <YEeFEbNUVkZaXDp4@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <e745809b-b6c7-7b6a-b598-4e3bbd3e48d7@gmail.com>
On Tue, Mar 09, 2021 at 11:12:34AM +0100, Eric Dumazet wrote:
> Interesting !
>
> It seems seqcount_latch_init() might benefit from something similar.
Indeed so. I've added the below on top.
---
Subject: seqlock,lockdep: Fix seqcount_latch_init()
From: Peter Zijlstra <peterz@infradead.org>
Date: Tue Mar 9 15:21:18 CET 2021
seqcount_init() must be a macro in order to preserve the static
variable that is used for the lockdep key. Don't then wrap it in an
inline function, which destroys that.
Luckily there aren't many users of this function, but fix it before it
becomes a problem.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
include/linux/seqlock.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -664,10 +664,7 @@ typedef struct {
* seqcount_latch_init() - runtime initializer for seqcount_latch_t
* @s: Pointer to the seqcount_latch_t instance
*/
-static inline void seqcount_latch_init(seqcount_latch_t *s)
-{
- seqcount_init(&s->seqcount);
-}
+#define seqcount_latch_init(s) seqcount_init(&(s)->seqcount)
/**
* raw_read_seqcount_latch() - pick even/odd latch data copy
next prev parent reply other threads:[~2021-03-09 14:25 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.
2021-03-09 7:54 ` Peter Zijlstra
2021-03-09 10:12 ` Eric Dumazet
2021-03-09 14:24 ` Peter Zijlstra [this message]
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=YEeFEbNUVkZaXDp4@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=a.darwish@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=erhard_f@mailbox.org \
--cc=eric.dumazet@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.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).