From: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>
To: Dominik Maier <dmnk@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>
Cc: Lance Yang <lance.yang@linux.dev>,
linux-mm@kvack.org, dmnk+artist@google.com
Subject: Re: [PATCH] hugetlbfs: cap shared mmap reservation at i_size under F_SEAL_GROW
Date: Mon, 30 Nov 2026 23:44:43 +0100 [thread overview]
Message-ID: <72fd1e92-5380-46f2-b758-05c6ea57ce22@gmail.com> (raw)
In-Reply-To: <20261130160417.2643255-1-dmnk@google.com>
On 11/30/26 5:04 PM, Dominik Maier wrote:
> Shared mmap() on a growth-sealed hugetlbfs file still reserves huge
> pages past EOF, pinning pages that can never be faulted in.
>
> With F_SEAL_GROW set, mmap() no longer extends the file size, but it
> still reserves pages up to the end of the mapping. On shared mappings,
> those reservations beyond EOF stay recorded on the inode across munmap()
> and remain charged against huge page pools and cgroups until the file is
> truncated or closed.
>
> Cap the shared reservation end offset at the sealed file size so mmap()
> succeeds without reserving unreachable huge pages.
>
> Fixes: ff62a3421044 ("hugetlb: implement memfd sealing")
> Cc: stable@vger.kernel.org
> Suggested-by: David Hildenbrand (Arm) <david@kernel.org>
> Signed-off-by: Dominik Maier <dmnk@google.com>
LGTM:
Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
--
cheers,
jose a. p-a
prev parent reply other threads:[~2026-11-30 22:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 16:04 [PATCH] hugetlbfs: cap shared mmap reservation at i_size under F_SEAL_GROW Dominik Maier
2026-11-30 22:44 ` Jose A. Perez de Azpillaga [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=72fd1e92-5380-46f2-b758-05c6ea57ce22@gmail.com \
--to=azpijr@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=dmnk+artist@google.com \
--cc=dmnk@google.com \
--cc=lance.yang@linux.dev \
--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