diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2025-11-19 18:27:22 +0100 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2025-11-25 19:45:42 +0100 |
| commit | 653fda7ae73d8033dedb65537acac0c2c287dc3f (patch) | |
| tree | 767d8491def78517d86b1d064b613888693d9fad /kernel/fork.c | |
| parent | 9da6ccbcea3de1fa704202e3346fe6c0226bfc18 (diff) | |
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
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 6c23219e1169..8475958e029b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -956,7 +956,6 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) #ifdef CONFIG_SCHED_MM_CID tsk->mm_cid.cid = MM_CID_UNSET; - tsk->mm_cid.last_cid = MM_CID_UNSET; tsk->mm_cid.active = 0; #endif return tsk; |