Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages

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

 



On Fri, Feb 24, 2017 at 11:12:18AM +0900, Minchan Kim wrote:
> > @@ -1525,8 +1531,8 @@ int try_to_unmap(struct page *page, enum ttu_flags flags)
> >  
> >  	if (ret != SWAP_MLOCK && !page_mapcount(page)) {
> >  		ret = SWAP_SUCCESS;
> > -		if (rp.lazyfreed && !PageDirty(page))
> > -			ret = SWAP_LZFREE;
> > +		if (rp.lazyfreed && PageDirty(page))
> > +			ret = SWAP_DIRTY;
> 
> Hmm, I don't understand why we need to introduce new return value.
> Can't we set SetPageSwapBacked and return SWAP_FAIL in try_to_unmap_one?

I think that's a bad idea. A function called "try_to_unmap" shouldn't
have as a side effect that it changes the page's LRU type in an error
case. Let try_to_unmap be about unmapping the page. If it fails, make
it report why and let the caller deal with the fallout. Any LRU fixups
are much better placed in vmscan.c.

--
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 OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux