Re: [patch V3 20/20] sched/mmcid: Switch over to the new mechanism
From: Mathieu Desnoyers
Date: Thu Oct 30 2025 - 12:07:26 EST
On 2025-10-29 09:09, Thomas Gleixner wrote:
@@ -10702,10 +10758,43 @@ void sched_mm_cid_exit(struct task_struc
if (!mm || !t->mm_cid.active)
return;
+ /*
+ * Ensure that only one instance is doing MM CID operations within
+ * a MM. The common case is uncontended. The rare fixup case adds
+ * some overhead.
+ */
+ scoped_guard(mutex, &mm->mm_cid.mutex) {
When exiting from a mm where mm->mm_cid.users == 1 (read with
READ_ONCE()), can we do this without holding the mutex as an
optimization ?
+ * Synchronize eventally pending work to ensure that there are no
eventually
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com