X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=kernel%2Ffork.c;h=6d42242485cb2863e940ae0d54983a2d34789096;hb=b66484cd74706fa8681d051840fe4b18a3da40ff;hp=9a05bd93f8e72872e5086e60c2ecde396846ab06;hpb=9a687aea2ffd8ab1e3c6239ea53c0a2209707bd5;p=cascardo%2Flinux.git 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) { taskstats_tgid_free(sig); sched_autogroup_exit(sig); + /* + * __mmdrop is not safe to call from softirq context on x86 due to + * pgd_dtor so postpone it to the async context + */ + if (sig->oom_mm) + mmdrop_async(sig->oom_mm); kmem_cache_free(signal_cachep, sig); } @@ -848,6 +854,7 @@ static inline void __mmput(struct mm_struct *mm) ksm_exit(mm); khugepaged_exit(mm); /* must run before exit_mmap */ exit_mmap(mm); + mm_put_huge_zero_page(mm); set_mm_exe_file(mm, NULL); if (!list_empty(&mm->mmlist)) { spin_lock(&mmlist_lock); @@ -856,6 +863,7 @@ static inline void __mmput(struct mm_struct *mm) } if (mm->binfmt) module_put(mm->binfmt->module); + set_bit(MMF_OOM_SKIP, &mm->flags); mmdrop(mm); }