uma: Show the count of free slabs in each per-domain keg's sysctl tree

This is useful for measuring the number of pages that could be freed
from a NOFREE zone under memory pressure.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d6e77cda9b)
This commit is contained in:
Mark Johnston 2021-09-17 12:13:47 -04:00
parent cb7bb946f7
commit e68465ecbf

View file

@ -2526,7 +2526,10 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused)
"Total pages currently allocated from VM");
SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"free_items", CTLFLAG_RD, &dom->ud_free_items, 0,
"items free in the slab layer");
"Items free in the slab layer");
SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"free_slabs", CTLFLAG_RD, &dom->ud_free_slabs, 0,
"Unused slabs");
}
} else
SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,