Skip to content

Commit 90dfeef

Browse files
Peter Zijlstraingomolnar
authored andcommitted
seqlock: Cure some more scoped_seqlock() optimization fails
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. [ mingo: Clang fails the build too in some circumstances. ] Reported-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Link: https://patch.msgid.link/20251204104332.GG2528459@noisy.programming.kicks-ass.net
1 parent 24bc5ea commit 90dfeef

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/seqlock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ struct ss_tmp {
12241224
spinlock_t *lock_irqsave;
12251225
};
12261226

1227-
static inline void __scoped_seqlock_cleanup(struct ss_tmp *sst)
1227+
static __always_inline void __scoped_seqlock_cleanup(struct ss_tmp *sst)
12281228
{
12291229
if (sst->lock)
12301230
spin_unlock(sst->lock);
@@ -1252,7 +1252,7 @@ static inline void __scoped_seqlock_bug(void) { }
12521252
extern void __scoped_seqlock_bug(void);
12531253
#endif
12541254

1255-
static inline void
1255+
static __always_inline void
12561256
__scoped_seqlock_next(struct ss_tmp *sst, seqlock_t *lock, enum ss_state target)
12571257
{
12581258
switch (sst->state) {

0 commit comments

Comments
 (0)