linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Yajun Deng <yajun.deng@linux.dev>
Cc: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: unified folio_test_anon()/folio_anon_vma() and use them
Date: Thu, 11 Jul 2024 14:08:32 +0100	[thread overview]
Message-ID: <Zo_ZULOseAmEQMIw@casper.infradead.org> (raw)
In-Reply-To: <20240711130351.2830-1-yajun.deng@linux.dev>

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.


  reply	other threads:[~2024-07-11 13:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 13:03 Yajun Deng
2024-07-11 13:08 ` Matthew Wilcox [this message]
2024-07-12  2:29   ` Yajun Deng
2024-07-12  2:59     ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zo_ZULOseAmEQMIw@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yajun.deng@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox