aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 9a05bd93f8e7..6d42242485cb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -359,6 +359,12 @@ static inline void free_signal_struct(struct signal_struct *sig)
359{ 359{
360 taskstats_tgid_free(sig); 360 taskstats_tgid_free(sig);
361 sched_autogroup_exit(sig); 361 sched_autogroup_exit(sig);
362 /*
363 * __mmdrop is not safe to call from softirq context on x86 due to
364 * pgd_dtor so postpone it to the async context
365 */
366 if (sig->oom_mm)
367 mmdrop_async(sig->oom_mm);
362 kmem_cache_free(signal_cachep, sig); 368 kmem_cache_free(signal_cachep, sig);
363} 369}
364 370
@@ -848,6 +854,7 @@ static inline void __mmput(struct mm_struct *mm)
848 ksm_exit(mm); 854 ksm_exit(mm);
849 khugepaged_exit(mm); /* must run before exit_mmap */ 855 khugepaged_exit(mm); /* must run before exit_mmap */
850 exit_mmap(mm); 856 exit_mmap(mm);
857 mm_put_huge_zero_page(mm);
851 set_mm_exe_file(mm, NULL); 858 set_mm_exe_file(mm, NULL);
852 if (!list_empty(&mm->mmlist)) { 859 if (!list_empty(&mm->mmlist)) {
853 spin_lock(&mmlist_lock); 860 spin_lock(&mmlist_lock);
@@ -856,6 +863,7 @@ static inline void __mmput(struct mm_struct *mm)
856 } 863 }
857 if (mm->binfmt) 864 if (mm->binfmt)
858 module_put(mm->binfmt->module); 865 module_put(mm->binfmt->module);
866 set_bit(MMF_OOM_SKIP, &mm->flags);
859 mmdrop(mm); 867 mmdrop(mm);
860} 868}
861 869