HomeFreeBSD

vm_page: Fix nofree page accounting

Description

vm_page: Fix nofree page accounting

In commit ae10431c9833 ("vm_page: Allow PG_NOFREE pages to be freed"), I
changed the v_nofree_count counter to instead count the size of the
nofree queue, on the basis that with the ability to free nofree pages,
the size of the queue is unbounded.

The use of a counter(9) for this purpose is not really correct, as early
initialization of per-CPU counters interferes with precise accounting
that we want here. Instead, add a global tracker for this purpose,
expose it elsewhere in the sysctl tree, and restore v_free_nofree's
original use as a counter of allocated nofree pages.

Reviewed by: bnovkov, alc, kib
Reported by: alc
Fixes: ae10431c9833 ("vm_page: Allow PG_NOFREE pages to be freed")
Differential Revision: https://reviews.freebsd.org/D50877

Details

Provenance
markjAuthored on Jun 18 2025, 9:14 PM
Reviewer
rGae10431c9833: vm_page: Allow PG_NOFREE pages to be freed
Differential Revision
D50877: vm_page: Fix nofree page accounting
Parents
rGf1f71cc717aa: fwget: pci_intel_video: do no log on no match
Branches
Unknown
Tags
Unknown