[RFC PATCH 0/2] Introduce serialized smp_call_function APIs

From: Mathieu Desnoyers
Date: Wed Mar 13 2024 - 16:56:35 EST


commit 944d5fe50f3f ("sched/membarrier: reduce the ability to hammer on sys_membarrier")
introduces a mutex over all membarrier operations to reduce its ability
to slow down the rest of the system.

This RFC series has two objectives:

1) Move this mutex to the smp_call_function APIs so other system calls
using smp_call_function IPIs are limited in the same way,

2) Restore scalability of MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ with
MEMBARRIER_CMD_FLAG_CPU, which targets specific CPUs with IPIs.
This may or may not be useful, and I would welcome benchmarks from
users of this feature to figure out if this is worth it.

This series applies on top of v6.8.

Thanks,

Mathieu

Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
Cc: Andrew Hunter <ahh@xxxxxxxxxx>
Cc: Maged Michael <maged.michael@xxxxxxxxx>
Cc: gromer@xxxxxxxxxx
Cc: Avi Kivity <avi@xxxxxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Peter Oskolkov <posk@xxxxxxxxxx>

Mathieu Desnoyers (2):
smp: Implement serialized smp_call_function APIs
sched/membarrier: Use serialized smp_call_function APIs

include/linux/smp.h | 40 ++++++++++++++
kernel/sched/membarrier.c | 24 +++------
kernel/smp.c | 106 +++++++++++++++++++++++++++++++++-----
3 files changed, 141 insertions(+), 29 deletions(-)

--
2.39.2