]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/mmcid: Avoid full tasklist walks
authorThomas Gleixner <tglx@kernel.org>
Tue, 10 Mar 2026 20:29:09 +0000 (21:29 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 11 Mar 2026 11:01:07 +0000 (12:01 +0100)
commit192d852129b1b7c4f0ddbab95d0de1efd5ee1405
treeb683e4093b5c8b4366556c818a3fe95ed00015b7
parent7574ac6e49789ddee1b1be9b2afb42b4a1b4b1f4
sched/mmcid: Avoid full tasklist walks

Chasing vfork()'ed tasks on a CID ownership mode switch requires a full
task list walk, which is obviously expensive on large systems.

Avoid that by keeping a list of tasks using a mm MMCID entity in mm::mm_cid
and walk this list instead. This removes the proven to be flaky counting
logic and avoids a full task list walk in the case of vfork()'ed tasks.

Fixes: fbd0e71dc370 ("sched/mmcid: Provide CID ownership mode fixup functions")
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260310202526.183824481@kernel.org
include/linux/rseq_types.h
kernel/fork.c
kernel/sched/core.c