linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	David Rientjes <rientjes@google.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] mm, migrate: increment fail count on ENOMEM
Date: Tue, 24 May 2016 08:17:25 +0200	[thread overview]
Message-ID: <20160524061724.GA8259@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.LSU.2.11.1605231618360.22555@eggly.anvils>

On Mon 23-05-16 16:32:56, Hugh Dickins wrote:
> On Mon, 23 May 2016, Andrew Morton wrote:
> > On Fri, 20 May 2016 15:31:21 +0200 Michal Hocko <mhocko@kernel.org> wrote:
> > > On Fri 20-05-16 15:19:12, Vlastimil Babka wrote:
> > > > On 05/20/2016 03:06 PM, Michal Hocko wrote:
> > > [...]
> > > > > Why don't we need also to count also retries?
> > > > 
> > > > We could, but not like you suggest.
> > > > 
> > > > > ---
> > > > > diff --git a/mm/migrate.c b/mm/migrate.c
> > > > > index 53ab6398e7a2..ef9c5211ae3c 100644
> > > > > --- a/mm/migrate.c
> > > > > +++ b/mm/migrate.c
> > > > > @@ -1190,9 +1190,9 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> > > > >   			}
> > > > >   		}
> > > > >   	}
> > > > > +out:
> > > > >   	nr_failed += retry;
> > > > >   	rc = nr_failed;
> > > > 
> > > > This overwrites rc == -ENOMEM, which at least compaction needs to recognize.
> > > > But we could duplicate "nr_failed += retry" in the case -ENOMEM.
> > > 
> > > Right you are. So we should do
> > > ---
> > > diff --git a/mm/migrate.c b/mm/migrate.c
> > > index 53ab6398e7a2..123fed94022b 100644
> > > --- a/mm/migrate.c
> > > +++ b/mm/migrate.c
> > > @@ -1171,6 +1171,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
> > >  
> > >  			switch(rc) {
> > >  			case -ENOMEM:
> > > +				nr_failed += retry + 1;
> > >  				goto out;
> > >  			case -EAGAIN:
> > >  				retry++;
> > > 	
> > > 
> > 
> > argh, this was lost.  Please resend as a real patch sometime?
> 
> It's not correct.  "retry" is reset to 0 each time around the
> loop, and it's only a meaningful number to add on to nr_failed, in
> the case when we've gone through the whole list: not in this "goto
> out" case. 

You are right! I've missed that, my bad.

> We could add another loop to count how many are left
> when we hit -ENOMEM, and add that on to nr_failed; but I'm not
> convinced that it's worth the bother.

Agreed!

Sorry about the noise!
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-05-24  6:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 22:11 David Rientjes
2016-05-20 13:06 ` Michal Hocko
2016-05-20 13:19   ` Vlastimil Babka
2016-05-20 13:31     ` Michal Hocko
2016-05-23 22:02       ` Andrew Morton
2016-05-23 23:32         ` Hugh Dickins
2016-05-24  6:17           ` Michal Hocko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160524061724.GA8259@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox