diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 086fe73ad6bd..5721f0e3f2da 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -532,11 +532,12 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p) | |||
532 | mm->flags = (current->mm) ? | 532 | mm->flags = (current->mm) ? |
533 | (current->mm->flags & MMF_INIT_MASK) : default_dump_filter; | 533 | (current->mm->flags & MMF_INIT_MASK) : default_dump_filter; |
534 | mm->core_state = NULL; | 534 | mm->core_state = NULL; |
535 | mm->nr_ptes = 0; | 535 | atomic_long_set(&mm->nr_ptes, 0); |
536 | memset(&mm->rss_stat, 0, sizeof(mm->rss_stat)); | 536 | memset(&mm->rss_stat, 0, sizeof(mm->rss_stat)); |
537 | spin_lock_init(&mm->page_table_lock); | 537 | spin_lock_init(&mm->page_table_lock); |
538 | mm_init_aio(mm); | 538 | mm_init_aio(mm); |
539 | mm_init_owner(mm, p); | 539 | mm_init_owner(mm, p); |
540 | clear_tlb_flush_pending(mm); | ||
540 | 541 | ||
541 | if (likely(!mm_alloc_pgd(mm))) { | 542 | if (likely(!mm_alloc_pgd(mm))) { |
542 | mm->def_flags = 0; | 543 | mm->def_flags = 0; |
@@ -560,7 +561,7 @@ static void check_mm(struct mm_struct *mm) | |||
560 | "mm:%p idx:%d val:%ld\n", mm, i, x); | 561 | "mm:%p idx:%d val:%ld\n", mm, i, x); |
561 | } | 562 | } |
562 | 563 | ||
563 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 564 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS |
564 | VM_BUG_ON(mm->pmd_huge_pte); | 565 | VM_BUG_ON(mm->pmd_huge_pte); |
565 | #endif | 566 | #endif |
566 | } | 567 | } |
@@ -814,12 +815,9 @@ struct mm_struct *dup_mm(struct task_struct *tsk) | |||
814 | memcpy(mm, oldmm, sizeof(*mm)); | 815 | memcpy(mm, oldmm, sizeof(*mm)); |
815 | mm_init_cpumask(mm); | 816 | mm_init_cpumask(mm); |
816 | 817 | ||
817 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 818 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS |
818 | mm->pmd_huge_pte = NULL; | 819 | mm->pmd_huge_pte = NULL; |
819 | #endif | 820 | #endif |
820 | #ifdef CONFIG_NUMA_BALANCING | ||
821 | mm->first_nid = NUMA_PTE_SCAN_INIT; | ||
822 | #endif | ||
823 | if (!mm_init(mm, tsk)) | 821 | if (!mm_init(mm, tsk)) |
824 | goto fail_nomem; | 822 | goto fail_nomem; |
825 | 823 | ||
@@ -1313,7 +1311,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1313 | #endif | 1311 | #endif |
1314 | 1312 | ||
1315 | /* Perform scheduler related setup. Assign this task to a CPU. */ | 1313 | /* Perform scheduler related setup. Assign this task to a CPU. */ |
1316 | sched_fork(p); | 1314 | sched_fork(clone_flags, p); |
1317 | 1315 | ||
1318 | retval = perf_event_init_task(p); | 1316 | retval = perf_event_init_task(p); |
1319 | if (retval) | 1317 | if (retval) |
@@ -1373,7 +1371,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1373 | INIT_LIST_HEAD(&p->pi_state_list); | 1371 | INIT_LIST_HEAD(&p->pi_state_list); |
1374 | p->pi_state_cache = NULL; | 1372 | p->pi_state_cache = NULL; |
1375 | #endif | 1373 | #endif |
1376 | uprobe_copy_process(p); | ||
1377 | /* | 1374 | /* |
1378 | * sigaltstack should be cleared when sharing the same VM | 1375 | * sigaltstack should be cleared when sharing the same VM |
1379 | */ | 1376 | */ |
@@ -1490,6 +1487,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1490 | perf_event_fork(p); | 1487 | perf_event_fork(p); |
1491 | 1488 | ||
1492 | trace_task_newtask(p, clone_flags); | 1489 | trace_task_newtask(p, clone_flags); |
1490 | uprobe_copy_process(p, clone_flags); | ||
1493 | 1491 | ||
1494 | return p; | 1492 | return p; |
1495 | 1493 | ||