From: Muchun Song <muchun.song@linux.dev>
To: Hongfu Li <hongfu.li@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <kees@kernel.org>,
Colin Ian King <colin.i.king@gmail.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Mina Almasry <almasrymina@google.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hongfu Li <lihongfu@kylinos.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting
Date: Thu, 17 Sep 2026 14:08:01 +0800 [thread overview]
Message-ID: <595A571A-C790-4AAA-BA11-F95D44BB063D@linux.dev> (raw)
In-Reply-To: <20260916-for-hugetlb-charge-v1-2-70fb708b2e4a@kylinos.cn>
> On Sep 16, 2026, at 16:30, Hongfu Li <hongfu.li@linux.dev> wrote:
>
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> hugetlb_cgroup_css_offline() hands the folios of a dying cgroup over to
> its parent with hugetlb_cgroup_move_parent(), which moves the page_counter
> charges and the hugetlb_cgroup pointer of the folio but not its per-node
> usage. The parent's hugetlb.<size>.numa_stat is short by that usage while
> they are charged, and underflows once they are freed, exposing incorrect
> per-node usage values to userspace.
>
> Move the per-node usage to the parent as well. The folios keep their node
> here, so only the cgroup which holds the usage changes.
>
> Fixes: f47761999052 ("hugetlb: add hugetlb.*.numa_stat file")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Acked-by: Muchun Song <muchun.song@linux.dev>
next prev parent reply other threads:[~2026-09-17 6:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 8:30 [PATCH 0/2] mm/hugetlb_cgroup: move the per-node usage along with the folio Hongfu Li
2026-09-16 8:30 ` [PATCH 1/2] mm/hugetlb_cgroup: move per-node usage on cross node migration Hongfu Li
2026-09-17 5:58 ` Muchun Song
2026-09-17 9:59 ` Hongfu Li
2026-09-16 8:30 ` [PATCH 2/2] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting Hongfu Li
2026-09-17 6:08 ` Muchun Song [this message]
2026-09-17 0:53 ` [PATCH 0/2] mm/hugetlb_cgroup: move the per-node usage along with the folio Andrew Morton
2026-09-17 10:17 ` Hongfu Li
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=595A571A-C790-4AAA-BA11-F95D44BB063D@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=almasrymina@google.com \
--cc=colin.i.king@gmail.com \
--cc=david@kernel.org \
--cc=hongfu.li@linux.dev \
--cc=kees@kernel.org \
--cc=lihongfu@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=osalvador@suse.de \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
/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.