On Fri, May 30, 2014 at 11:17 AM, Richard Weinberger <richard.weinber...@gmail.com> wrote: > On Fri, May 30, 2014 at 10:24 AM, enjoy mindful <enjoymind...@gmail.com> > wrote: >> Hi, >> When I'm trace uml kernel with gdb, I found there are two mem_map >> (struct page) arrays. >> >> 1) the first one created in init_maps function, and pointed by *local* >> pointer struct page *map in init_maps function >> >> arch/um/kernel/um_arch.c >> 264 int __init linux_main(int argc, char **argv) >> ..... >> 350 setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem); >> 351 if (init_maps(physmem_size, iomem_size, highmem)) { >> 352 printf("Failed to allocate mem_map for %Lu bytes >> of physical " >> 353 "memory and %Lu bytes of highmem\n", physmem_size, >> 354 highmem); >> 355 exit(1); >> 356 } >> >> 2) the second mem_map created in >> start_kernel -> setup_arch -> paging_init -> free_area_init -> >> free_area_init_core -> alloc_node_mem_map >> >> and it has been pointer by global pointer "contig_page_data->node_mem_map" >> >> Why need struct page array (the first one) for boot memory allocate? I >> tried to deleted the 351~356 lines in linux_main function and the >> built/run the uml kernel. The new kernel can boot and run. But it may >> panic. > > Linux has only one mem_map array, defined in mm/memory. > I also fail to see how the kernel can work if you delete the call to > init_maps(). > > *confused* :)
So, I gave it a try and it really works. Wut? Feel free to send a cleanup patch which explains in details why it works. Looks like you found old code. :D -- Thanks, //richard ------------------------------------------------------------------------------ Time is money. Stop wasting it! Get your web API in 5 minutes. www.restlet.com/download http://p.sf.net/sfu/restlet _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel