mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user