[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <9f6a864e-f608-4543-874e-09ab034717e9@app.fastmail.com>
Date: Thu, 04 Dec 2025 15:05:55 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Peter Zijlstra" <peterz@...radead.org>, "Ingo Molnar" <mingo@...nel.org>,
"Oleg Nesterov" <oleg@...hat.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: seqlock: Cure some more scoped_seqlock() optimization fails
On Thu, Dec 4, 2025, at 11:43, Peter Zijlstra wrote:
> Arnd reported an x86 randconfig using gcc-15 tripped over
> __scoped_seqlock_bug(). Turns out GCC chose not to inline the
> scoped_seqlock helper functions and as such was not able to optimize
> properly.
>
> Reported-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Tested-by: Arnd Bergmann <arnd@...db.de>
>
> -static inline void __scoped_seqlock_cleanup(struct ss_tmp *sst)
> +static __always_inline void __scoped_seqlock_cleanup(struct ss_tmp *sst)
> {
> if (sst->lock)
> spin_unlock(sst->lock);
> @@ -1252,7 +1252,7 @@ static inline void __scoped_seqlock_bug(void) { }
> extern void __scoped_seqlock_bug(void);
> #endif
>
> -static inline void
> +static __always_inline void
> __scoped_seqlock_next(struct ss_tmp *sst, seqlock_t *lock, enum
> ss_state target)
> {
> switch (sst->state) {
It looks I got close: I had tried the __always_inline on
__scoped_seqlock_next but missed the one on __scoped_seqlock_cleanup,
so that was not enough.
Your version addresses the issue for me, thanks a lot for the fix!
Arnd
Powered by blists - more mailing lists