[PATCH 6.12.y 0/2] Please backport wake_q drain follow-ups

Simon Liebold <[email protected]>
Newsgroups org.kernel.vger.stable,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi, please backport the following two commits to the 6.12.y stable tree.

After commit 4a0779145781 ("locking/rtmutex: Make sure we wake anything on the
wake_q when we release the lock->wait_lock") landed in v6.12.96, we observed a
fio null_blk throughput regression (128K / iodepth=1 / numjobs=64, Graviton3 /
m7g.16xlarge), because that commit makes the rt_mutex / mutex release path run
an unconditional

    preempt_disable();
    raw_spin_unlock(lock);
    wake_up_q(wake_q);
    preempt_enable();

drain on every release, even though wake_q is only ever populated on the
ww_mutex path.

After checking why we are not seeing this in mainline, I found that we are
missing commit abfdccd6af2b ("sched/wake_q: Add helper to call wake_up_q after
unlock with preemption disabled") in 6.12.y. Even though it looks like a
refactor, it adds an if (wake_q), gating the wake queue drain.

Commit 5ec58525a1f1 ("locking/mutex: Make mutex::wait_lock irq safe") is
backported to make the former apply cleanly.

Simon

John Stultz (1):
  sched/wake_q: Add helper to call wake_up_q after unlock with
    preemption disabled

Juri Lelli (1):
  locking/mutex: Make mutex::wait_lock irq safe

 include/linux/sched/wake_q.h | 34 ++++++++++++++++++++++++++++++++++
 kernel/futex/pi.c            |  5 +----
 kernel/locking/mutex.c       | 26 ++++++++++----------------
 kernel/locking/rtmutex.c     | 32 +++++---------------------------
 kernel/locking/ww_mutex.h    | 21 +++++++++++----------
 5 files changed, 61 insertions(+), 57 deletions(-)


base-commit: 833291ee77846538926c990bcb468f6f54e9af50
-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.