diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-20 22:44:41 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-20 22:44:41 -0400 |
commit | 6f0266b77d44edd22ca19adb5cb56ef79d33d94f (patch) | |
tree | b6f4bae5ac440afb23b0e055c1a677d458b310d3 /sys/vm | |
parent | bf48729c47e3b7c762d97238370fea99748433b7 (diff) |
kernel: physmem: Update page counts on alloc/free
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_physmem.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_physmem.c b/sys/vm/vm_physmem.c index b6e7347..f8caf9a 100644 --- a/sys/vm/vm_physmem.c +++ b/sys/vm/vm_physmem.c @@ -194,6 +194,8 @@ vm_alloc_frame(size_t count) ret = __vm_alloc_frame(count); } + pages_used += count; + pages_free -= count; spinlock_release(&lock); return ret; } @@ -209,6 +211,8 @@ vm_free_frame(uintptr_t base, size_t count) for (uintptr_t p = base; p < stop_at; p += DEFAULT_PAGESIZE) { clrbit(bitmap, p / DEFAULT_PAGESIZE); } + pages_used -= count; + pages_free += count; spinlock_release(&lock); } |