From: Andrew Morton <akpm@linux-foundation.org>
To: Catherine <enderaoelyther@gmail.com>
Cc: Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: fix subpool accounting after cgroup charge failure
Date: Mon, 27 Apr 2026 08:12:13 -0700 [thread overview]
Message-ID: <20260427081213.7935edd49d96622b08e81643@linux-foundation.org> (raw)
In-Reply-To: <20260427145247.84157-2-enderaoelyther@gmail.com>
On Mon, 27 Apr 2026 22:52:48 +0800 Catherine <enderaoelyther@gmail.com> wrote:
> alloc_hugetlb_folio() calls hugepage_subpool_get_pages() when map_chg
> is set. For subpools with max_hpages, that increments used_hpages even
> when the returned gbl_chg is positive.
>
> If a later hugetlb cgroup charge fails, the cleanup currently calls
> hugepage_subpool_put_pages() only for !gbl_chg. The gbl_chg > 0 path
> therefore leaks one used_hpages charge per failure.
>
> Always undo the subpool charge after a successful subpool get. Keep the
> global reservation accounting under !gbl_chg, because only that path
> consumed a reservation from the subpool.
Thanks.
We do prefer full, real names for kernel alterations. Can you please
provide that?
next prev parent reply other threads:[~2026-04-27 15:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 14:52 [PATCH] mm/hugetlb: fix subpool accounting after cgroup charge failure Catherine
2026-04-27 15:12 ` Andrew Morton [this message]
2026-04-27 15:19 ` Catherine
2026-04-27 21:12 ` Andrew Morton
2026-04-28 3:07 ` [PATCH v2] " Zhao Li
2026-04-28 9:08 ` Oscar Salvador
2026-04-28 11:30 ` Lance Yang
2026-04-28 11:41 ` Zhao Li
2026-04-28 11:41 ` Zhao Li
2026-04-28 11:30 ` [PATCH v3] mm/hugetlb: fix max-only subpool accounting on alloc_hugetlb_folio failure Zhao 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=20260427081213.7935edd49d96622b08e81643@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=enderaoelyther@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
/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