impove memory accounting
. the total amount of memory in the system didn't include the memory used by the boot-time modules and some dynamic allocation by the kernel at boot time (to map in VM). especially apparent on our ARM board with 'only' 512MB of memory and a huge ramdisk. . also: *add* the VM loaded module to the freelist after it has been allocated for & mapped in instead of cutting it *out* of the freelist! so we get a few more MB free.. Change-Id: If37ac32b21c9d38610830e21421264da4f20bc4f
This commit is contained in:
@@ -81,6 +81,7 @@ phys_bytes alloc_lowest(kinfo_t *cbi, phys_bytes len)
|
||||
}
|
||||
assert(lowest != EMPTY);
|
||||
cut_memmap(cbi, lowest, len);
|
||||
cbi->kernel_allocated_bytes_dynamic += len;
|
||||
return lowest;
|
||||
}
|
||||
|
||||
@@ -152,6 +153,8 @@ phys_bytes pg_alloc_page(kinfo_t *cbi)
|
||||
|
||||
mmap->len -= I386_PAGE_SIZE;
|
||||
|
||||
cbi->kernel_allocated_bytes_dynamic += I386_PAGE_SIZE;
|
||||
|
||||
return mmap->addr + mmap->len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user