Linux filesystem development
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Jinjiang Tu <tujinjiang@huawei.com>,
	akpm@linux-foundation.org, ziy@nvidia.com, luizcap@redhat.com,
	willy@infradead.org, linmiaohe@huawei.com,
	svetly.todorov@memverge.com, xu.xin16@zte.com.cn,
	chengming.zhou@linux.dev, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org
Cc: wangkefeng.wang@huawei.com, sunnanyong@huawei.com
Subject: Re: [PATCH v2] fs/proc: fix KPF_KSM reported for all anonymous pages
Date: Fri, 26 Jun 2026 10:13:53 +0200	[thread overview]
Message-ID: <a63b7138-617f-46de-96f9-e56528aee3aa@kernel.org> (raw)
In-Reply-To: <20260626013252.2846774-1-tujinjiang@huawei.com>

On 6/26/26 03:32, Jinjiang Tu wrote:
> Reading /proc/kpageflags for any anonymous page returns KPF_KSM set, even
> when KSM is not in use. As a result, tools misclassify all anonymous pages
> as KSM merged.
> 
> In stable_page_flags(), if the page is anonymous, then use (mapping &
> FOLIO_MAPPING_KSM) check to identify if the anonymous page is KSM page.
> However, FOLIO_MAPPING_KSM is FOLIO_MAPPING_ANON | FOLIO_MAPPING_ANON_KSM,
> (mapping & FOLIO_MAPPING_KSM) check returns true for all nonymous pages.
> 
> To fix it, use FOLIO_MAPPING_ANON_KSM instead.
> 
> Fixes: dee3d0bef2b0 ("proc: rewrite stable_page_flags()")
> Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>
> ---

With spelling fix

Acked-by: David Hildenbrand (Arm) <david@kernel.org>

And I'd appreciate if someone could look into cleaning up the code to switch
back to folio helpers now that we have folio+page snapshots.

-- 
Cheers,

David

  parent reply	other threads:[~2026-06-26  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26  1:32 [PATCH v2] fs/proc: fix KPF_KSM reported for all anonymous pages Jinjiang Tu
2026-06-26  2:09 ` xu.xin16
2026-06-26  6:28   ` Jinjiang Tu
2026-06-26  8:13 ` David Hildenbrand (Arm) [this message]
2026-06-26  9:02   ` Jinjiang Tu
2026-06-26 14:08 ` Zi Yan

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=a63b7138-617f-46de-96f9-e56528aee3aa@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=linmiaohe@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luizcap@redhat.com \
    --cc=sunnanyong@huawei.com \
    --cc=svetly.todorov@memverge.com \
    --cc=tujinjiang@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=xu.xin16@zte.com.cn \
    --cc=ziy@nvidia.com \
    /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