On Sat, Mar 09, 2019 at 03:02:22PM +0900, Tetsuo Handa wrote: > @@ -1120,8 +1122,13 @@ void pagefault_out_of_memory(void) > if (mem_cgroup_oom_synchronize(true)) > return; > > - if (!mutex_trylock(&oom_lock)) > + if (!mutex_trylock(&oom_lock)) { /* * Explain why we still need this on the fail back. */ > + oom_reclaim_acquire(GFP_KERNEL, 0); > + oom_reclaim_release(GFP_KERNEL, 0); > return; > + } /* * This changes the try-lock to a regular lock; because ..... * text goes here. */ > + oom_reclaim_release(GFP_KERNEL, 0); > + oom_reclaim_acquire(GFP_KERNEL, 0); > out_of_memory(&oc); > mutex_unlock(&oom_lock); > } > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6d0fa5b..e8853a19 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3793,6 +3793,8 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...) > schedule_timeout_uninterruptible(1); > return NULL; > } idem > + oom_reclaim_release(gfp_mask, order); > + oom_reclaim_acquire(gfp_mask, order); > > /* > * Go through the zonelist yet one more time, keep very high watermark these things might seem 'obvious' now, but I'm sure that the next time I see this I'll go WTF?!