From: "Oscar Salvador (SUSE)" <osalvador@kernel.org>
To: Muchun Song <muchun.song@linux.dev>
Cc: Kaitao Cheng <kaitao.cheng@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
Frank van der Linden <fvdl@google.com>,
Michal Hocko <mhocko@suse.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Chris Down <chris@chrisdown.name>,
Roman Gushchin <roman.gushchin@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kaitao Cheng <chengkaitao@kylinos.cn>
Subject: Re: [PATCH 3/3] mm/hugetlb: fix NR_HUGETLB accounting for unused surplus folios
Date: Thu, 29 Oct 2026 14:22:48 +0100 [thread overview]
Message-ID: <auNIqE_Zz5AK6-uj@localhost.localdomain> (raw)
In-Reply-To: <87146009-8E2A-467B-AAFF-8F79E9D5E32F@linux.dev>
On Thu, Oct 29, 2026 at 11:21:47AM +0800, Muchun Song wrote:
> My thinking is that we should not use lruvec_stat_mod_folio(). Instead, we
> should use mod_node_page_state() and mod_memcg_lruvec_state()
> independently. In that case, when a new hugetlb page is allocated, we could
> account for it directly via mod_node_page_state(). The reason is tha
> lruvec_stat_mod_folio() also accounts per-memcg NR_HUGETLB; only by
> splitting the two can we minimize the problems introduced by accounting. For
> callers that need to consider memcg, mod_memcg_lruvec_state() can be used.
Ok, this sounds pretty compeling, and IMHO makes sense.
I mean I get the ideabehind this patch but it feels like papering over
the real problem.
> I expect that after some cleanup, there will be only one place that needs to
> handle per-node NR_HUGETLB.
>
> Thoughts?
>
> Thanks,
> Muchun
>
>
> > I will have another look later on.
> >
> >
> >
> > --
> > Oscar Salvador
> > SUSE Labs
>
--
Oscar Salvador
SUSE Labs
prev parent reply other threads:[~2026-10-29 13:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 11:33 [PATCH 0/3] Subject: mm/hugetlb: fix CMA handling and surplus allocation accounting Kaitao Cheng
2026-10-28 11:33 ` [PATCH 1/3] mm/hugetlb_cma: fix incorrect hugetlb_cma_size assignment on malformed input Kaitao Cheng
2026-10-28 13:47 ` Muchun Song
2026-10-28 14:46 ` Oscar Salvador (SUSE)
2026-10-28 11:33 ` [PATCH 2/3] mm/hugetlb: preserve CMA flag when returning folios to the pool Kaitao Cheng
2026-10-28 13:56 ` Muchun Song
2026-10-28 14:00 ` Zi Yan
2026-10-28 11:33 ` [PATCH 3/3] mm/hugetlb: fix NR_HUGETLB accounting for unused surplus folios Kaitao Cheng
2026-10-28 15:01 ` Oscar Salvador (SUSE)
2026-10-29 3:21 ` Muchun Song
2026-10-29 13:22 ` Oscar Salvador (SUSE) [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=auNIqE_Zz5AK6-uj@localhost.localdomain \
--to=osalvador@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=chengkaitao@kylinos.cn \
--cc=chris@chrisdown.name \
--cc=david@kernel.org \
--cc=fvdl@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kaitao.cheng@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=roman.gushchin@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