Re: [PATCH v2 0/8] Introduce a huge-page pre-zeroing mechanism

From: Li Zhe

Date: Mon Jan 12 2026 - 06:26:13 EST


On Wed, 7 Jan 2026 08:19:21 -0800, akpm@xxxxxxxxxxxxxxxxxxxx wrote:

> > In user space, we can use system calls such as epoll and write to zero
> > huge folios as they become available, and sleep when none are ready. The
> > following pseudocode illustrates this approach. The pseudocode spawns
> > eight threads (each running thread_fun()) that wait for huge pages on
> > node 0 to become eligible for zeroing; whenever such pages are available,
> > the threads clear them in parallel.
>
> This seems to be quite a lot of messing around in userspace. Perhaps
> unavoidable given the tradeoffs which are involved, and reasonable in
> the sort of environments in which this will be used.

Apologies for the delayed response. I share the same view.

> I guess there are many alternatives - let's see what others think.

Let's cc the developers who took part in the earlier discussion and
see whether any better ideas emerge.

> > fs/hugetlbfs/inode.c | 3 +-
> > include/linux/hugetlb.h | 26 +++++
> > mm/hugetlb.c | 131 ++++++++++++++++++++++---
> > mm/hugetlb_internal.h | 6 ++
> > mm/hugetlb_sysfs.c | 206 ++++++++++++++++++++++++++++++++++++----
> > 5 files changed, 337 insertions(+), 35 deletions(-)
>
> Let's find places in Documentation/ (and Documentation/ABI) to document
> the userspace interface?

I believe this userspace interface should be documented in
'Documentation/admin-guide/mm/hugetlbpage.rst', and I will include
this update in V3.

However, I noticed that no document under 'Documentation/ABI' explicitly
describe the interfaces under directory
'/sys/devices/system/node/nodeX/hugepages/hugepages-<size>/'. Instead, it
points directly to 'Documentation/admin-guide/mm/hugetlbpage.rst' (see
'Documentation/ABI/stable/sysfs-devices-node').

Given this, is it sufficient to only modify
'Documentation/admin-guide/mm/hugetlbpage.rst'?

Thanks,
Zhe