Page MenuHomeFreeBSD

vm_page: Fix nofree page accounting
ClosedPublic

Authored by markj on Jun 16 2025, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 8, 4:00 AM
Unknown Object (File)
Mon, Oct 6, 3:22 PM
Unknown Object (File)
Tue, Sep 30, 8:45 PM
Unknown Object (File)
Fri, Sep 26, 10:00 AM
Unknown Object (File)
Fri, Sep 26, 8:20 AM
Unknown Object (File)
Fri, Sep 19, 8:00 AM
Unknown Object (File)
Fri, Sep 19, 1:33 AM
Unknown Object (File)
Sep 13 2025, 10:34 AM
Subscribers

Details

Summary

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.

Reported by: alc
Fixes: ae10431c9833 ("vm_page: Allow PG_NOFREE pages to be freed")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jun 16 2025, 3:00 PM
sys/vm/vm_page.c
2548

Should the ops be atomic, if you want precision?

markj marked an inline comment as done.

Make the queue size update atomic.

This revision is now accepted and ready to land.Jun 16 2025, 5:02 PM
This revision was automatically updated to reflect the committed changes.