From: Muchun Song <muchun.song@linux.dev>
To: James Houghton <jthoughton@google.com>
Cc: Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Rapoport <rppt@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hugetlb: Don't restore vmemmap of non-HVOed folios on bulk restore error
Date: Tue, 17 Nov 2026 09:57:57 +0800 [thread overview]
Message-ID: <1041A207-7114-479F-AB70-8EA33AB361A5@linux.dev> (raw)
In-Reply-To: <20261116221557.3128331-1-jthoughton@google.com>
> On Nov 17, 2026, at 06:15, James Houghton <jthoughton@google.com> wrote:
>
> When hugetlb_vmemmap_restore_folios() fails, it stops processing the
> list, so folio_list may still contain folios that were never vmemmap
> optimized, e.g. because HVO failed when they were allocated. Their
> hugetlb flag has already been cleared by remove_hugetlb_folio().
>
> If no folios could be restored, bulk_vmemmap_restore_error() then calls
> hugetlb_vmemmap_restore_folio() on every folio left on folio_list,
> including those, which trips the !folio_test_hugetlb() check in
> __hugetlb_vmemmap_restore_folio():
>
> page dumped because: VM_WARN_ON_ONCE_FOLIO(!folio_test_hugetlb(folio))
> WARNING: mm/hugetlb_vmemmap.c:503 at __hugetlb_vmemmap_restore_folio+0x270/0x300
> ...
> __hugetlb_vmemmap_restore_folio+0x270/0x300 (P)
> hugetlb_vmemmap_restore_folio+0x1c/0x30
> update_and_free_pages_bulk+0x2c0/0x368
> __nr_hugepages_store_common+0x2e8/0x3f0
>
> Otherwise this is benign: the restore is a no-op returning success for
> non-optimized folios, which are then freed as intended.
>
> Skip the restore for folios that are not vmemmap optimized; they can be
> freed right away.
>
> This is very unlikely to happen without fault injection, as it requires
> both HVO and a subsequent vmemmap restore to fail.
>
> Fixes: cfb8c75099db ("hugetlb: perform vmemmap restoration on a list of pages")
> Signed-off-by: James Houghton <jthoughton@google.com>
Reviewed-by: Muchun Song (ByteDance) <muchun.song@linux.dev>
Thanks.
prev parent reply other threads:[~2026-11-17 1:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 22:15 James Houghton
2026-11-17 1:57 ` Muchun Song [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=1041A207-7114-479F-AB70-8EA33AB361A5@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=jthoughton@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=rppt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®