[Bug 292265] shm_create_largepage() does not appear to allocate large pages

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 08 Jan 2026 09:09:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292265

            Bug ID: 292265
           Summary: shm_create_largepage() does not appear to allocate
                    large pages
           Product: Base System
           Version: 15.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: cryintothebluesky@gmail.com
 Attachment #266931 text/plain
         mime type:

Created attachment 266931
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=266931&action=edit
Test program to reproduce the issue

I have a test program which allocates 4 GiB shared memory segment and attempts
to use shm_create_largepage() with 2 MiB pages. The expectation is that 2048
large pages would be allocated, however procstat reports many more pages,
suggesting that smaller 4 KiB pages are used instead.

procstat vm $(pgrep test_large_pages)
...
   PID              START                END PRT     RES    PRES REF SHD FLAG 
TP PATH
 38528        0x822e00000        0x922e00000 rw- 1048576 1048576   2   0 -----
ph posixshm@anon

Number of pages allocated is way more than the expected 2048

I'm not sure if this is a bug in shm_create_largepage() or incorrect procstat
page counters.

-- 
You are receiving this mail because:
You are the assignee for the bug.