lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.11.1605231618360.22555@eggly.anvils>
Date:	Mon, 23 May 2016 16:32:56 -0700 (PDT)
From:	Hugh Dickins <hughd@...gle.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	Michal Hocko <mhocko@...nel.org>, Vlastimil Babka <vbabka@...e.cz>,
	David Rientjes <rientjes@...gle.com>,
	Mel Gorman <mgorman@...hsingularity.net>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] mm, migrate: increment fail count on ENOMEM

On Mon, 23 May 2016, Andrew Morton wrote:
> On Fri, 20 May 2016 15:31:21 +0200 Michal Hocko <mhocko@...nel.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.  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.

Hugh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ