Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589193

Re: Still OOM problems with 4.9er/4.10er kernels

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: Still OOM problems with 4.9er/4.10er kernels
Date 2017-02-28 06:50 +0100
Message-ID <tfIPD-8sl-5@gated-at.bofh.it> (permalink)
References (5 earlier) <sVPqF-2eb-7@gated-at.bofh.it> <sVPTI-2FK-13@gated-at.bofh.it> <tf2GK-4hL-3@gated-at.bofh.it> <tfpDj-3t3-1@gated-at.bofh.it> <tfqpH-45z-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 27, 2017 at 10:44:49AM +0100, Michal Hocko wrote:
> On Mon 27-02-17 18:02:36, Minchan Kim wrote:
> [...]
> > >From 9779a1c5d32e2edb64da5cdfcd6f9737b94a247a Mon Sep 17 00:00:00 2001
> > From: Minchan Kim <minchan@kernel.org>
> > Date: Mon, 27 Feb 2017 17:39:06 +0900
> > Subject: [PATCH] mm: use up highatomic before OOM kill
> > 
> > Not-Yet-Signed-off-by: Minchan Kim <minchan@kernel.org>
> > ---
> >  mm/page_alloc.c | 14 ++++----------
> >  1 file changed, 4 insertions(+), 10 deletions(-)
> > 
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 614cd0397ce3..e073cca4969e 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -3549,16 +3549,6 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
> >  		*no_progress_loops = 0;
> >  	else
> >  		(*no_progress_loops)++;
> > -
> > -	/*
> > -	 * Make sure we converge to OOM if we cannot make any progress
> > -	 * several times in the row.
> > -	 */
> > -	if (*no_progress_loops > MAX_RECLAIM_RETRIES) {
> > -		/* Before OOM, exhaust highatomic_reserve */
> > -		return unreserve_highatomic_pageblock(ac, true);
> > -	}
> > -
> >  	/*
> >  	 * Keep reclaiming pages while there is a chance this will lead
> >  	 * somewhere.  If none of the target zones can satisfy our allocation
> > @@ -3821,6 +3811,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> >  	if (read_mems_allowed_retry(cpuset_mems_cookie))
> >  		goto retry_cpuset;
> >  
> > +	/* Before OOM, exhaust highatomic_reserve */
> > +	if (unreserve_highatomic_pageblock(ac, true))
> > +		goto retry;
> > +
> 
> OK, this can help for higher order requests when we do not exhaust all
> the retries and fail on compaction but I fail to see how can this help
> for order-0 requets which was what happened in this case. I am not
> saying this is wrong, though.

The should_reclaim_retry can return false although no_progress_loop is less
than MAX_RECLAIM_RETRIES unless eligible zones has enough reclaimable pages
by the progress_loop. In that case, unreserve_highatomic_pageblock cannot
be called so that VM can keep a pageblock(e.g., 2M) for highatomic reserve.
Then, zone_watermark_ok subtracts nr_reserved_highatomic pages for the
pass/fail decision whichs is very conservative but no choice for the hot
path performance. With that, order-0 allocation can be failed.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Still OOM problems with 4.9er/4.10er kernels Gerhard Wiesinger <lists@wiesinger.com> - 2017-02-26 09:50 +0100
  Re: Still OOM problems with 4.9er/4.10er kernels Michal Hocko <mhocko@kernel.org> - 2017-02-27 09:30 +0100
    Re: Still OOM problems with 4.9er/4.10er kernels Gerhard Wiesinger <lists@wiesinger.com> - 2017-02-28 07:20 +0100
      Re: Still OOM problems with 4.9er/4.10er kernels Michal Hocko <mhocko@kernel.org> - 2017-02-28 09:20 +0100
  Re: Still OOM problems with 4.9er/4.10er kernels Minchan Kim <minchan@kernel.org> - 2017-02-27 10:20 +0100
    Re: Still OOM problems with 4.9er/4.10er kernels Michal Hocko <mhocko@kernel.org> - 2017-02-27 11:10 +0100
      Re: Still OOM problems with 4.9er/4.10er kernels Minchan Kim <minchan@kernel.org> - 2017-02-28 06:50 +0100
        Re: Still OOM problems with 4.9er/4.10er kernels Michal Hocko <mhocko@kernel.org> - 2017-02-28 09:30 +0100

csiph-web