Change free to used in new coremap function.

This commit is contained in:
Geoffrey Challen 2016-03-05 11:00:48 -05:00
parent a367007689
commit a07a4b75c1
3 changed files with 6 additions and 7 deletions

View File

@ -128,7 +128,7 @@ free_kpages(vaddr_t addr)
unsigned unsigned
int int
coremap_free_bytes() { coremap_used_bytes() {
/* dumbvm doesn't track page allocations. Return 0 so that khu works. */ /* dumbvm doesn't track page allocations. Return 0 so that khu works. */

View File

@ -56,12 +56,11 @@ vaddr_t alloc_kpages(unsigned npages);
void free_kpages(vaddr_t addr); void free_kpages(vaddr_t addr);
/* /*
* Return amount of free memory (in bytes) available in unallocated coremap pages. * Return amount of memory (in bytes) used by allocated coremap pages. If
* If there are ongoing allocations, this value could change after it is * there are ongoing allocations, this value could change after it is returned
* returned to the caller. But it should have been correct at some point in * to the caller. But it should have been correct at some point in time.
* time.
*/ */
unsigned int coremap_free_bytes(void); unsigned int coremap_used_bytes(void);
/* TLB shootdown handling called from interprocessor_interrupt */ /* TLB shootdown handling called from interprocessor_interrupt */
void vm_tlbshootdown_all(void); void vm_tlbshootdown_all(void);

View File

@ -834,7 +834,7 @@ kheap_printused(void)
for (pr = allbase; pr != NULL; pr = pr->next_all) { for (pr = allbase; pr != NULL; pr = pr->next_all) {
total += subpage_stats(pr, true); total += subpage_stats(pr, true);
} }
total += coremap_free_bytes(); total += coremap_used_bytes();
spinlock_release(&kmalloc_spinlock); spinlock_release(&kmalloc_spinlock);
snprintf(total_string, sizeof(total_string), "%lu", total); snprintf(total_string, sizeof(total_string), "%lu", total);