Re: [patch] mm, migrate: increment fail count on ENOMEM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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++;
	

-- 
Michal Hocko
SUSE Labs

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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]