NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59897: NetBSD virtual memory subsystem should support larger page sizes



>Number:         59897
>Category:       kern
>Synopsis:       NetBSD virtual memory subsystem should support larger page sizes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 08 11:25:00 +0000 2026
>Originator:     Sad Clouds
>Release:        10.1_STABLE
>Organization:
>Environment:
>Description:
Linux, FreeBSD and Solaris virtual memory subsystems implement support for multiple pages sizes via various non-portable APIs. Unfortunately OpenBSD and NetBSD seem to be lagging behind in this area.

I'm not a kernel developer, however I think NetBSD can use large pages internally within the kernel address space, but there is absolutely no such facility exposed to the user space.

There is a significant performance advantage associated with large pages for memory intensive applications. For example FreeBSD-15 on amd64 can use 4KiB, 2MiB, and 1GiB page sizes via shm_create_largepage(). My own testing shows how much difference this can make when allocating and page faulting a 64 GiB memory segment:

4KiB pages: 38557 msec to prefault 64 GiB
2MiB pages: 299 msec to prefault 64 GiB

That is about 128 times quicker when using 2MiB page sizes.

Linux and Solaris show smaller performance differences between different page sizes but still significant enough to make this feature worthwhile.

FreeBSD shm_create_largepage() API is not the best design and a bit awkward to use. Extensions to mmap() to select specific page sizes would be a better design for NetBSD.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index