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: <20170217054555.GB3653@bbox>
Date:   Fri, 17 Feb 2017 14:45:55 +0900
From:   Minchan Kim <minchan@...nel.org>
To:     Shaohua Li <shli@...com>
CC:     Johannes Weiner <hannes@...xchg.org>, <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 V3 3/7] mm: reclaim MADV_FREE pages

Hi Shaohua,

On Thu, Feb 16, 2017 at 04:27:18PM -0800, Shaohua Li wrote:
> On Thu, Feb 16, 2017 at 01:40:18PM -0500, Johannes Weiner wrote:
> > On Tue, Feb 14, 2017 at 11:36:09AM -0800, Shaohua Li wrote:
> > > @@ -1419,11 +1419,18 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> > >  			VM_BUG_ON_PAGE(!PageSwapCache(page) && PageSwapBacked(page),
> > >  				page);
> > >  
> > > -			if (!PageDirty(page) && (flags & TTU_LZFREE)) {
> > > -				/* It's a freeable page by MADV_FREE */
> > > -				dec_mm_counter(mm, MM_ANONPAGES);
> > > -				rp->lazyfreed++;
> > > -				goto discard;
> > > +			if (flags & TTU_LZFREE) {
> > > +				if (!PageDirty(page)) {
> > > +					/* It's a freeable page by MADV_FREE */
> > > +					dec_mm_counter(mm, MM_ANONPAGES);
> > > +					rp->lazyfreed++;
> > > +					goto discard;
> > > +				} else {
> > > +					set_pte_at(mm, address, pvmw.pte, pteval);
> > > +					ret = SWAP_FAIL;
> > > +					page_vma_mapped_walk_done(&pvmw);
> > > +					break;
> > > +				}
> > 
> > I don't understand why we need the TTU_LZFREE bit in general. More on
> > that below at the callsite.
> 
> Sounds useless flag, don't see any reason we shouldn't free the MADV_FREE page
> in places other than reclaim. Looks TTU_UNMAP is useless too..

Agree on TTU_UNMAP but for example, THP split doesn't mean free lazyfree pages,
I think.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ