diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-10-13 15:09:52 (GMT) |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-10-13 15:09:52 (GMT) |
commit | 6267cf38eda00c2eade2f5959abb2b931850294d (patch) | |
tree | 6b98066b25fcbd7344802220d172ae9edc53ae20 /mm | |
parent | 7547ed9d3c6eb3e645f16951864973e342a8994a (diff) | |
parent | 9d36d3eff2f85efad0a3b0c6031081654ae33928 (diff) | |
download | linux-6267cf38eda00c2eade2f5959abb2b931850294d.tar.xz |
Merge tag 'v4.9.56' into linux-linaro-lsk-v4.9
This is the 4.9.56 stable release
Diffstat (limited to 'mm')
-rw-r--r-- | mm/oom_kill.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index ec9f11d..d631d25 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -37,6 +37,7 @@ #include <linux/ratelimit.h> #include <linux/kthread.h> #include <linux/init.h> +#include <linux/mmu_notifier.h> #include <asm/tlb.h> #include "internal.h" @@ -491,6 +492,21 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm) } /* + * If the mm has notifiers then we would need to invalidate them around + * unmap_page_range and that is risky because notifiers can sleep and + * what they do is basically undeterministic. So let's have a short + * sleep to give the oom victim some more time. + * TODO: we really want to get rid of this ugly hack and make sure that + * notifiers cannot block for unbounded amount of time and add + * mmu_notifier_invalidate_range_{start,end} around unmap_page_range + */ + if (mm_has_notifiers(mm)) { + up_read(&mm->mmap_sem); + schedule_timeout_idle(HZ); + goto unlock_oom; + } + + /* * increase mm_users only after we know we will reap something so * that the mmput_async is called only when we have reaped something * and delayed __mmput doesn't matter that much |