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]
Date:   Sat, 25 Feb 2017 08:26:24 +0900
From:   Minchan Kim <minchan@...nel.org>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Shaohua Li <shli@...com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Kernel-team@...com, mhocko@...e.com,
        hughd@...gle.com, riel@...hat.com, mgorman@...hsingularity.net,
        akpm@...ux-foundation.org
Subject: Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages

Hi Johannes,

On Fri, Feb 24, 2017 at 10:36:55AM -0500, Johannes Weiner wrote:
> 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.

I don't think it's page's LRU type change. SetPageSwapBacked is just
indication that page is swappable or not.
Like mlock_vma_page in try_to_unmap_one, we can set SetPageSwapBacked
if we found the lazyfree page dirty. If we don't need to move dirty
lazyfree page to another LRU list, it would be better to not introduce
new return value in try_to_unmap.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ