]> Gentwo Git Trees - linux/.git/commit
sched/mmcid: Switch over to the new mechanism
authorThomas Gleixner <tglx@linutronix.de>
Wed, 19 Nov 2025 17:27:22 +0000 (18:27 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 25 Nov 2025 18:45:42 +0000 (19:45 +0100)
commit653fda7ae73d8033dedb65537acac0c2c287dc3f
tree767d8491def78517d86b1d064b613888693d9fad
parent9da6ccbcea3de1fa704202e3346fe6c0226bfc18
sched/mmcid: Switch over to the new mechanism

Now that all pieces are in place, change the implementations of
sched_mm_cid_fork() and sched_mm_cid_exit() to adhere to the new strict
ownership scheme and switch context_switch() over to use the new
mm_cid_schedin() functionality.

The common case is that there is no mode change required, which makes
fork() and exit() just update the user count and the constraints.

In case that a new user would exceed the CID space limit the fork() context
handles the transition to per CPU mode with mm::mm_cid::mutex held. exit()
handles the transition back to per task mode when the user count drops
below the switch back threshold. fork() might also be forced to handle a
deferred switch back to per task mode, when a affinity change increased the
number of allowed CPUs enough.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251119172550.280380631@linutronix.de
include/linux/rseq.h
include/linux/rseq_types.h
kernel/fork.c
kernel/sched/core.c
kernel/sched/sched.h