linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ackerley Tng <ackerleytng@google.com>
To: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org,
	 linux-fsdevel@vger.kernel.org
Subject: [LSF/MM/BPF TOPIC] Opening HugeTLB up for more generic use
Date: Wed, 25 Feb 2026 18:59:56 -0800	[thread overview]
Message-ID: <CAEvNRgFvHNH6GwuY5yLYD+0OK19mC3pRJKDBR=HsKgym=rghWA@mail.gmail.com> (raw)

Hi all,

I would like to propose to open HugeTLB up for more generic use.

Motivation
==========

This proposal was motivated by guest_memfd needing to provide huge
pages. guest_memfd wraps existing allocators to provide memory for
backing KVM virtual machines, and wants to use HugeTLB as a source of
huge pages.

Proposal details
================

The proposal is to (re)think the in-memory filesystems as memory
providers around memory sources:

| Memory Provider                | Memory Source            |
|--------------------------------|--------------------------|
| Anonymous (mmap(MAP_ANONYMOUS) | Buddy allocator          |
| Tmpfs/shmem                    | Buddy allocator          |
| HugeTLBfs                      | HugeTLB                  |
| guest_memfd                    | Buddy allocator, HugeTLB |

While working on HugeTLB and exploring HugeTLBfs vs HugeTLB, my
impression is that these two are overly coupled together and could
benefit from better conceptual separation, as well as code separation
between mm/hugetlb.c and fs/hugetlbfs/inode.c.

Status
======

I've been working on guest_memfd HugeTLB support for a while now, and
Google is in the process of qualifying guest_memfd HugeTLB
support. Here [1] is an earlier version of what's being qualified.

Here [2] is an RFC patch series, split out from [1] and updated, that
refactors the HugeTLB allocation routine for more generic use. I hope
this will serve as a starting point for this discussion.

Goals of the discussion
=======================

+ Find out what the community thinks of opening up HugeTLB as a more
  generic source of huge pages, not coupled to HugeTLBfs
    + Get feedback on guest_memfd using HugeTLB
+ Find out what the plan is for HugeTLB(fs) testing
    + Is the plan to continue maintaining tests in libhugetlbfs?
    + Should the tests be migrated as kernel selftests?
+ Gather key components that would need refactoring

Requested attendees
===================

+ David Hildenbrand
+ Muchun Song
+ Oscar Salvador
+ Peter Xu

References
==========

[1] https://lore.kernel.org/all/cover.1726009989.git.ackerleytng@google.com/T/
[2] https://lore.kernel.org/all/cover.1770854662.git.ackerleytng@google.com/T/
[3] https://github.com/libhugetlbfs/libhugetlbfs/


Thanks,

Ackerley


                 reply	other threads:[~2026-02-26  3:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAEvNRgFvHNH6GwuY5yLYD+0OK19mC3pRJKDBR=HsKgym=rghWA@mail.gmail.com' \
    --to=ackerleytng@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.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