From: "Zi Yan" <ziy@nvidia.com>
To: "Jinjiang Tu" <tujinjiang@huawei.com>,
<akpm@linux-foundation.org>, <david@kernel.org>,
<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:08:34 -0400 [thread overview]
Message-ID: <DJJ1GI9R9KYX.VRUNK0PHFG85@nvidia.com> (raw)
In-Reply-To: <20260626013252.2846774-1-tujinjiang@huawei.com>
On Thu Jun 25, 2026 at 9:32 PM EDT, 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>
> ---
> Changelog in v2:
> * use FOLIO_MAPPING_KSM to match explictly instead of use FOLIO_MAPPING_ANON_KSM
> only.
>
> fs/proc/page.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
LGTM. Thanks.
Acked-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
prev parent reply other threads:[~2026-06-26 14:08 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)
2026-06-26 9:02 ` Jinjiang Tu
2026-06-26 14:08 ` Zi Yan [this message]
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=DJJ1GI9R9KYX.VRUNK0PHFG85@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=david@kernel.org \
--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 \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.