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: <20170227162803.GL26504@dhcp22.suse.cz>
Date:   Mon, 27 Feb 2017 17:28:03 +0100
From:   Michal Hocko <mhocko@...nel.org>
To:     Shaohua Li <shli@...com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Kernel-team@...com, minchan@...nel.org, hughd@...gle.com,
        hannes@...xchg.org, riel@...hat.com, mgorman@...hsingularity.net,
        akpm@...ux-foundation.org
Subject: Re: [PATCH V5 2/6] mm: don't assume anonymous pages have SwapBacked
 flag

On Mon 27-02-17 08:10:24, Shaohua Li wrote:
> On Mon, Feb 27, 2017 at 03:35:34PM +0100, Michal Hocko wrote:
> > On Fri 24-02-17 13:31:45, Shaohua Li wrote:
> > > There are a few places the code assumes anonymous pages should have
> > > SwapBacked flag set. MADV_FREE pages are anonymous pages but we are
> > > going to add them to LRU_INACTIVE_FILE list and clear SwapBacked flag
> > > for them. The assumption doesn't hold any more, so fix them.
> > > 
> > > Cc: Michal Hocko <mhocko@...e.com>
> > > Cc: Minchan Kim <minchan@...nel.org>
> > > Cc: Hugh Dickins <hughd@...gle.com>
> > > Cc: Rik van Riel <riel@...hat.com>
> > > Cc: Mel Gorman <mgorman@...hsingularity.net>
> > > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > > Acked-by: Johannes Weiner <hannes@...xchg.org>
> > > Signed-off-by: Shaohua Li <shli@...com>

Anyway, feel free to add
Acked-by: Michal Hocko <mhocko@...e.com>

> > 
> > Looks good to me.
> > [...]
> > > index 96eb85c..c621088 100644
> > > --- a/mm/rmap.c
> > > +++ b/mm/rmap.c
> > > @@ -1416,7 +1416,8 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> > >  			 * Store the swap location in the pte.
> > >  			 * See handle_pte_fault() ...
> > >  			 */
> > > -			VM_BUG_ON_PAGE(!PageSwapCache(page), page);
> > > +			VM_BUG_ON_PAGE(!PageSwapCache(page) && PageSwapBacked(page),
> > > +				page);
> > 
> > just this part makes me scratch my head. I really do not understand what
> > kind of problem it tries to prevent from, maybe I am missing something
> > obvoious...
> 
> Just check a page which isn't lazyfree but wrongly enters here without swap
> entry. Or maybe you suggest we delete this statement?

Ohh, I figured out when seeing later patch in the series, I then wanted
to get back to this one but forgot... This on its own didn't really tell
me much. Maybe a comment would be helpful or even drop the VM_BUG_ON
altogether.
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ