delete unnecessary bootmem struct page array
PATCH 1/1 delete unnecessary bootmem struct page array
From: Honggang Li <[email protected]>
The patch based on linux-next-20140530.
Honggang Li (1):
delete unnecessary bootmem struct page array
arch/um/kernel/um_arch.c | 6 ------ 1 file changed, 6 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/1 delete unnecessary bootmem struct page array
From: Honggang Li <[email protected]>
1) uml kernel bootmem managed through bootmem_data->node_bootmem_map, not the struct page array, so the array is unnecessary.
2) the bootmem struct page array has been pointed by a *local* pointer, struct page *map, in init_maps function. The array can be accessed only in init_maps's scope. As a result, uml kernel wastes about 1% of total memory.
--- arch/um/kernel/um_arch.c | 6 ------ 1 file changed, 6 deletions(-)
arch/um/kernel/um_arch.c +0 -6
@@ -338,12 +338,6 @@ int __init linux_main(int argc, char **argv) start_vm =VMALLOC_START ;setup_physmem (uml_physmem, uml_reserved, physmem_size, highmem); -if (init_maps (physmem_size, iomem_size, highmem)) { -printf ("Failed to allocate mem_map for %Lu bytes of physical " -"memory and %Lu bytes of highmem\n" , physmem_size, - highmem); -exit (1 ); - } virtmem_size = physmem_size; stack = (unsigned long ) argv;
Signature · 1 line
1.8.3.1
Richard Weinberger
maintainerAm 01.06.2014 15:08, schrieb Real Name:
Quoted 9 lines
From: Honggang Li <[email protected]>
1) uml kernel bootmem managed through
bootmem_data->node_bootmem_map, not the struct page array, so the array is unnecessary.2) the bootmem struct page array has been pointed by a *local* pointer, struct page *map, in
init_mapsfunction. The array can be accessed only in init_maps's scope. As a result, uml kernel wastes about 1% of total memory.
I reread your patch again.
You missed one important point. init_maps() setups max_mapnr which is used by virt_addr_valid().
We have to be extremely careful here to not introduce a subtle fuckup.
Thanks,
//richard