From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbdB0OyE (ORCPT ); Mon, 27 Feb 2017 09:54:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:44060 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdB0Ox4 (ORCPT ); Mon, 27 Feb 2017 09:53:56 -0500 Date: Mon, 27 Feb 2017 15:35:34 +0100 From: Michal Hocko To: Shaohua Li Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kernel-team@fb.com, minchan@kernel.org, hughd@google.com, hannes@cmpxchg.org, riel@redhat.com, mgorman@techsingularity.net, akpm@linux-foundation.org Subject: Re: [PATCH V5 2/6] mm: don't assume anonymous pages have SwapBacked flag Message-ID: <20170227143534.GE26504@dhcp22.suse.cz> References: <3945232c0df3dd6c4ef001976f35a95f18dcb407.1487965799.git.shli@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3945232c0df3dd6c4ef001976f35a95f18dcb407.1487965799.git.shli@fb.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Minchan Kim > Cc: Hugh Dickins > Cc: Rik van Riel > Cc: Mel Gorman > Cc: Andrew Morton > Acked-by: Johannes Weiner > Signed-off-by: Shaohua Li 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... > > if (!PageDirty(page)) { > /* It's a freeable page by MADV_FREE */ > -- > 2.9.3 > -- Michal Hocko SUSE Labs