[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YEeFEbNUVkZaXDp4@hirez.programming.kicks-ass.net>
Date: Tue, 9 Mar 2021 15:24:17 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: "Erhard F." <erhard_f@...lbox.org>,
"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 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@...radead.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@...il.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.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
Powered by blists - more mailing lists