Introduce getters for page allocator shard stats

Access nactive, ndirty and nmuzzy throught getters and not directly.
There are no functional change, but getters are required to propagate
HPA's statistics up to Page Allocator's statitics.
This commit is contained in:
Dmitry Ilvokhin
2024-03-25 08:02:49 -07:00
committed by Qi Wang
parent 92aa52c062
commit b2e59a96e1
3 changed files with 25 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ pa_nactive_add(pa_shard_t *shard, size_t add_pages) {
static void
pa_nactive_sub(pa_shard_t *shard, size_t sub_pages) {
assert(atomic_load_zu(&shard->nactive, ATOMIC_RELAXED) >= sub_pages);
assert(pa_shard_nactive(shard) >= sub_pages);
atomic_fetch_sub_zu(&shard->nactive, sub_pages, ATOMIC_RELAXED);
}