diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-08 08:51:22 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-11-08 08:51:22 -0800 |
| commit | e6f55fe790a698aba6f98bf6ae4f1c04246c5040 (patch) | |
| tree | 431a16b87d584c502cd84d02330d6bcc35d81532 | |
| parent | 3636cfa745e6a4ff0142e29068750439059867b0 (diff) | |
| parent | 4cb5ac2626b5704ed712ac1d46b9d89fdfc12c5d (diff) | |
| download | linux-e6f55fe790a698aba6f98bf6ae4f1c04246c5040.tar.gz linux-e6f55fe790a698aba6f98bf6ae4f1c04246c5040.tar.bz2 linux-e6f55fe790a698aba6f98bf6ae4f1c04246c5040.zip | |
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
| -rw-r--r-- | kernel/futex/core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 125804fbb5cb..2e77a6e5c865 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1680,10 +1680,10 @@ static bool futex_ref_get(struct futex_private_hash *fph) { struct mm_struct *mm = fph->mm; - guard(rcu)(); + guard(preempt)(); - if (smp_load_acquire(&fph->state) == FR_PERCPU) { - this_cpu_inc(*mm->futex_ref); + if (READ_ONCE(fph->state) == FR_PERCPU) { + __this_cpu_inc(*mm->futex_ref); return true; } @@ -1694,10 +1694,10 @@ static bool futex_ref_put(struct futex_private_hash *fph) { struct mm_struct *mm = fph->mm; - guard(rcu)(); + guard(preempt)(); - if (smp_load_acquire(&fph->state) == FR_PERCPU) { - this_cpu_dec(*mm->futex_ref); + if (READ_ONCE(fph->state) == FR_PERCPU) { + __this_cpu_dec(*mm->futex_ref); return false; } |
