Re: [PATCH v2 00/13] sched/mmcid: fixes for execve, mode switches and affinity

From: Karl Mehltretter

Date: Tue Dec 01 2026 - 21:49:11 EST


On Tue, Dec 01, 2026 at 07:27:48PM +0100, Mathieu Desnoyers wrote:
> Mathieu Desnoyers (13):
> sched/mmcid: Move the execve() hooks into exec_mmap()
> sched/mmcid: Add the allowed CPUs of each joining task to the mm
> sched/mmcid: Serialize joins and exits with affinity changes by
> pi_lock
> sched/mmcid: Give no concurrency ID to user workers
> selftests/rseq: Test the concurrency ID after a failed execve
> selftests/rseq: Test the concurrency IDs across ownership mode
> switches
> selftests/rseq: Test the upper bound of the concurrency IDs
> selftests/rseq: Test an affinity change by another process during
> execve
> selftests/rseq: Test the concurrency IDs after the affinity is widened
> selftests/rseq: Test two race windows of the concurrency ID mode
> switches
> selftests/rseq: Test the last user after an affinity change during
> execve
> selftests/rseq: Test the concurrency IDs with an io_uring SQPOLL
> thread
> selftests/rseq: Test the concurrency IDs after clone3() into a wider
> cpuset
>

Two minor non-functional nits:
- In 02/13, mm_alloc_cid_noprof(mm, p) still takes an unused @p
parameter.
- In 03/13, sched_mm_cid_remove_user() adds lockdep_assert_held(&t->pi_lock),
whereas sched_mm_cid_add_user() does not.

Tested the full v2 series on edf8ee401674 in x86_64 KVM across KASAN and
PREEMPT_RT kernels (both with PROVE_LOCKING=y), on 2 and 4 vCPUs, plus
W=1 (fs/exec.o, kernel/sched/core.o) and CONFIG_RSEQ=n build checks:

- All five mm_cid_*_test selftests pass with zero failures (on 4 vCPUs,
mm_cid_bound_test cases 4 and 6 skip because they require >= 8 CPUs;
case 5 io_uring SQPOLL passes).
- CLONE_VM / vfork() allocation-failure injection, lock-wait signal
tests, and ptrace SIGSEGV-suppression tests all pass with valid
mm_cid and no kernel or lockdep warnings.

Tested-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

I was assisted by an LLM agent.

Thanks,
Karl