Merge tag 'v4.18-rc6' into for-4.19/block2
[linux-2.6-microblaze.git] / kernel / fork.c
index 67253e4..f40c82b 100644 (file)
@@ -308,9 +308,15 @@ static struct kmem_cache *vm_area_cachep;
 /* SLAB cache for mm_struct structures (tsk->mm) */
 static struct kmem_cache *mm_cachep;
 
-struct vm_area_struct *vm_area_alloc(void)
+struct vm_area_struct *vm_area_alloc(struct mm_struct *mm)
 {
-       return kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
+       struct vm_area_struct *vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
+
+       if (vma) {
+               vma->vm_mm = mm;
+               INIT_LIST_HEAD(&vma->anon_vma_chain);
+       }
+       return vma;
 }
 
 struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig)
@@ -862,6 +868,11 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
        tsk->fail_nth = 0;
 #endif
 
+#ifdef CONFIG_BLK_CGROUP
+       tsk->throttle_queue = NULL;
+       tsk->use_memdelay = 0;
+#endif
+
        return tsk;
 
 free_stack: