summaryrefslogtreecommitdiffstats
path: root/kernel/sched/membarrier.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-03-13 18:22:15 +0000
committerMark Brown <broonie@kernel.org>2024-03-13 18:22:15 +0000
commite25293d9d92cce24aa4ca21b90064661fe4d3fcf (patch)
tree50f45e19a3e397db28b6681d9bf3975f3c6dee8e /kernel/sched/membarrier.c
parent23fb6bc2696119391ec3a92ccaffe50e567c515e (diff)
parente8f897f4afef0031fe618a8e94127a0934896aba (diff)
downloadlinux-stable-e25293d9d92cce24aa4ca21b90064661fe4d3fcf.tar.gz
linux-stable-e25293d9d92cce24aa4ca21b90064661fe4d3fcf.tar.bz2
linux-stable-e25293d9d92cce24aa4ca21b90064661fe4d3fcf.zip
ASoC: Merge up release
In order to apply additional fixes that depend on the fixes merged for v6.8 merge up the final release.
Diffstat (limited to 'kernel/sched/membarrier.c')
-rw-r--r--kernel/sched/membarrier.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c
index 2ad881d07752..4e715b9b278e 100644
--- a/kernel/sched/membarrier.c
+++ b/kernel/sched/membarrier.c
@@ -162,6 +162,9 @@
| MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK \
| MEMBARRIER_CMD_GET_REGISTRATIONS)
+static DEFINE_MUTEX(membarrier_ipi_mutex);
+#define SERIALIZE_IPI() guard(mutex)(&membarrier_ipi_mutex)
+
static void ipi_mb(void *info)
{
smp_mb(); /* IPIs should be serializing but paranoid. */
@@ -259,6 +262,7 @@ static int membarrier_global_expedited(void)
if (!zalloc_cpumask_var(&tmpmask, GFP_KERNEL))
return -ENOMEM;
+ SERIALIZE_IPI();
cpus_read_lock();
rcu_read_lock();
for_each_online_cpu(cpu) {
@@ -347,6 +351,7 @@ static int membarrier_private_expedited(int flags, int cpu_id)
if (cpu_id < 0 && !zalloc_cpumask_var(&tmpmask, GFP_KERNEL))
return -ENOMEM;
+ SERIALIZE_IPI();
cpus_read_lock();
if (cpu_id >= 0) {
@@ -460,6 +465,7 @@ static int sync_runqueues_membarrier_state(struct mm_struct *mm)
* between threads which are users of @mm has its membarrier state
* updated.
*/
+ SERIALIZE_IPI();
cpus_read_lock();
rcu_read_lock();
for_each_online_cpu(cpu) {