Page MenuHomeFreeBSD

vm_page: Fix nofree page accounting
ClosedPublic

Authored by markj on Jun 16 2025, 3:00 PM.
Tags
None
Referenced Files
F137880783: D50877.diff
Wed, Nov 26, 7:52 PM
Unknown Object (File)
Sun, Nov 23, 4:04 PM
Unknown Object (File)
Sat, Nov 22, 11:20 PM
Unknown Object (File)
Sat, Nov 22, 12:42 AM
Unknown Object (File)
Fri, Nov 21, 10:27 AM
Unknown Object (File)
Fri, Nov 21, 10:01 AM
Unknown Object (File)
Fri, Nov 21, 9:58 AM
Unknown Object (File)
Fri, Nov 21, 9:57 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 64903
Build 61786: arc lint + arc unit

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.