]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - kernel/fork.c
Merge tag 'mm-stable-2023-02-20-13-37' of git://git.kernel.org/pub/scm/linux/kernel...
[thirdparty/linux.git] / kernel / fork.c
index 5e3029ea8e1ec26efc5495c559c0f58600797625..f68954d05e89dce1f7d430610322fff0a3a379f1 100644 (file)
@@ -1041,7 +1041,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
 #endif
 
 #ifdef CONFIG_BLK_CGROUP
-       tsk->throttle_queue = NULL;
+       tsk->throttle_disk = NULL;
        tsk->use_memdelay = 0;
 #endif
 
@@ -1057,6 +1057,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
        tsk->reported_split_lock = 0;
 #endif
 
+#ifdef CONFIG_SCHED_MM_CID
+       tsk->mm_cid = -1;
+       tsk->mm_cid_active = 0;
+#endif
        return tsk;
 
 free_stack:
@@ -1166,6 +1170,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
 
        mm->user_ns = get_user_ns(user_ns);
        lru_gen_init_mm(mm);
+       mm_init_cid(mm);
        return mm;
 
 fail_pcpu:
@@ -1598,6 +1603,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)
 
        tsk->mm = mm;
        tsk->active_mm = mm;
+       sched_mm_cid_fork(tsk);
        return 0;
 }
 
@@ -3031,7 +3037,7 @@ void __init mm_cache_init(void)
         * dynamically sized based on the maximum CPU number this system
         * can have, taking hotplug into account (nr_cpu_ids).
         */
-       mm_size = sizeof(struct mm_struct) + cpumask_size();
+       mm_size = sizeof(struct mm_struct) + cpumask_size() + mm_cid_size();
 
        mm_cachep = kmem_cache_create_usercopy("mm_struct",
                        mm_size, ARCH_MIN_MMSTRUCT_ALIGN,