aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index e40c0a01d5a6..bc0e96b78dfd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -28,6 +28,8 @@
28#include <linux/mman.h> 28#include <linux/mman.h>
29#include <linux/mmu_notifier.h> 29#include <linux/mmu_notifier.h>
30#include <linux/fs.h> 30#include <linux/fs.h>
31#include <linux/mm.h>
32#include <linux/vmacache.h>
31#include <linux/nsproxy.h> 33#include <linux/nsproxy.h>
32#include <linux/capability.h> 34#include <linux/capability.h>
33#include <linux/cpu.h> 35#include <linux/cpu.h>
@@ -364,7 +366,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
364 366
365 mm->locked_vm = 0; 367 mm->locked_vm = 0;
366 mm->mmap = NULL; 368 mm->mmap = NULL;
367 mm->mmap_cache = NULL; 369 mm->vmacache_seqnum = 0;
368 mm->map_count = 0; 370 mm->map_count = 0;
369 cpumask_clear(mm_cpumask(mm)); 371 cpumask_clear(mm_cpumask(mm));
370 mm->mm_rb = RB_ROOT; 372 mm->mm_rb = RB_ROOT;
@@ -882,6 +884,9 @@ static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)
882 if (!oldmm) 884 if (!oldmm)
883 return 0; 885 return 0;
884 886
887 /* initialize the new vmacache entries */
888 vmacache_flush(tsk);
889
885 if (clone_flags & CLONE_VM) { 890 if (clone_flags & CLONE_VM) {
886 atomic_inc(&oldmm->mm_users); 891 atomic_inc(&oldmm->mm_users);
887 mm = oldmm; 892 mm = oldmm;