diff --git a/kern/arch/mips/vm/dumbvm.c b/kern/arch/mips/vm/dumbvm.c index 5a7d619..1b2e6cd 100644 --- a/kern/arch/mips/vm/dumbvm.c +++ b/kern/arch/mips/vm/dumbvm.c @@ -128,7 +128,7 @@ free_kpages(vaddr_t addr) unsigned int -coremap_free_bytes() { +coremap_used_bytes() { /* dumbvm doesn't track page allocations. Return 0 so that khu works. */ diff --git a/kern/include/vm.h b/kern/include/vm.h index 96b6ffe..a783f33 100644 --- a/kern/include/vm.h +++ b/kern/include/vm.h @@ -56,12 +56,11 @@ vaddr_t alloc_kpages(unsigned npages); void free_kpages(vaddr_t addr); /* - * Return amount of free memory (in bytes) available in unallocated coremap pages. - * If there are ongoing allocations, this value could change after it is - * returned to the caller. But it should have been correct at some point in - * time. + * Return amount of memory (in bytes) used by allocated coremap pages. If + * there are ongoing allocations, this value could change after it is returned + * to the caller. But it should have been correct at some point in time. */ -unsigned int coremap_free_bytes(void); +unsigned int coremap_used_bytes(void); /* TLB shootdown handling called from interprocessor_interrupt */ void vm_tlbshootdown_all(void); diff --git a/kern/vm/kmalloc.c b/kern/vm/kmalloc.c index bc2771a..b4c4f3a 100644 --- a/kern/vm/kmalloc.c +++ b/kern/vm/kmalloc.c @@ -834,7 +834,7 @@ kheap_printused(void) for (pr = allbase; pr != NULL; pr = pr->next_all) { total += subpage_stats(pr, true); } - total += coremap_free_bytes(); + total += coremap_used_bytes(); spinlock_release(&kmalloc_spinlock); snprintf(total_string, sizeof(total_string), "%lu", total);