Skip to content

Commit e6f55fe

Browse files
committed
Merge tag 'locking-urgent-2025-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Ingo Molnar: "Fix (well, cut in half) a futex performance regression on PowerPC" * tag 'locking-urgent-2025-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Optimize per-cpu reference counting
2 parents 3636cfa + 4cb5ac2 commit e6f55fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/futex/core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,10 +1680,10 @@ static bool futex_ref_get(struct futex_private_hash *fph)
16801680
{
16811681
struct mm_struct *mm = fph->mm;
16821682

1683-
guard(rcu)();
1683+
guard(preempt)();
16841684

1685-
if (smp_load_acquire(&fph->state) == FR_PERCPU) {
1686-
this_cpu_inc(*mm->futex_ref);
1685+
if (READ_ONCE(fph->state) == FR_PERCPU) {
1686+
__this_cpu_inc(*mm->futex_ref);
16871687
return true;
16881688
}
16891689

@@ -1694,10 +1694,10 @@ static bool futex_ref_put(struct futex_private_hash *fph)
16941694
{
16951695
struct mm_struct *mm = fph->mm;
16961696

1697-
guard(rcu)();
1697+
guard(preempt)();
16981698

1699-
if (smp_load_acquire(&fph->state) == FR_PERCPU) {
1700-
this_cpu_dec(*mm->futex_ref);
1699+
if (READ_ONCE(fph->state) == FR_PERCPU) {
1700+
__this_cpu_dec(*mm->futex_ref);
17011701
return false;
17021702
}
17031703

0 commit comments

Comments
 (0)