[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zo_ZULOseAmEQMIw@casper.infradead.org>
Date: Thu, 11 Jul 2024 14:08:32 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Yajun Deng <yajun.deng@...ux.dev>
Cc: akpm@...ux-foundation.org, david@...hat.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: unified folio_test_anon()/folio_anon_vma() and use
them
On Thu, Jul 11, 2024 at 09:03:51PM +0800, Yajun Deng wrote:
> +++ b/include/linux/page-flags.h
> @@ -691,7 +691,8 @@ static __always_inline bool PageMappingFlags(const struct page *page)
>
> static __always_inline bool folio_test_anon(const struct folio *folio)
> {
> - return ((unsigned long)folio->mapping & PAGE_MAPPING_ANON) != 0;
> + return ((unsigned long)folio->mapping & PAGE_MAPPING_FLAGS) ==
> + PAGE_MAPPING_ANON;
> }
This is wrong. KSM pages are supposed to return true for
folio_test_anon(). I haven't looked any further at this patch, since
the premise appears to wrong and you clearly haven't tested.
Powered by blists - more mailing lists