All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting" failed to apply to 6.1-stable tree
@ 2026-11-07 10:47 Sasha Levin
  2026-11-10 14:34 ` [PATCH 6.1.y 1/4] mm/hugetlb_cgroup: convert set_hugetlb_cgroup*() to folios Sasha Levin
  0 siblings, 1 reply; 5+ messages in thread
From: Sasha Levin @ 2026-11-07 10:47 UTC (permalink / raw)
  To: lihongfu, akpm, muchun.song, colin.i.king, david, kees,
	almasrymina, osalvador, shakeel.butt
  Cc: stable

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 23fac055c21176f66ed453394b533bdfc00f7fba
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '20261107054727-failed-6.1-23fac055c211@kernel.org' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From 23fac055c21176f66ed453394b533bdfc00f7fba Mon Sep 17 00:00:00 2001
From: Hongfu Li <lihongfu@kylinos.cn>
Date: Fri, 18 Sep 2026 10:56:11 +0800
Subject: [PATCH] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting

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.

Link: https://lore.kernel.org/20260918-for-hugetlb-charge-v2-2-2b6d8c2bdc36@kylinos.cn
Fixes: f47761999052 ("hugetlb: add hugetlb.*.numa_stat file")
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: <stable@vger.kernel.org>
---
 mm/hugetlb_cgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 7cf7c18119b43..3fb41311e4c7d 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -241,6 +241,8 @@ static void hugetlb_cgroup_move_parent(int idx, struct hugetlb_cgroup *h_cg,
 	/* Take the pages off the local counter */
 	page_counter_cancel(counter, nr_pages);
 
+	hugetlb_cgroup_move_usage(h_cg, parent, folio, folio);
+
 	set_hugetlb_cgroup(folio, parent);
 out:
 	return;
-- 
2.53.0





^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-10 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 10:47 FAILED: patch "[PATCH] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting" failed to apply to 6.1-stable tree Sasha Levin
2026-11-10 14:34 ` [PATCH 6.1.y 1/4] mm/hugetlb_cgroup: convert set_hugetlb_cgroup*() to folios Sasha Levin
2026-11-10 14:34   ` [PATCH 6.1.y 2/4] mm/hugetlb_cgroup: convert hugetlb_cgroup_migrate " Sasha Levin
2026-11-10 14:34   ` [PATCH 6.1.y 3/4] mm/hugetlb_cgroup: move per-node usage on cross node migration Sasha Levin
2026-11-10 14:34   ` [PATCH 6.1.y 4/4] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting Sasha Levin

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.