Disabling the Bootmem Allocator

The bootmem allocator must be disabled once system initialization has progressed so far that the buddy system allocator can assume responsibility for memory management; after all, memory cannot be managed by two allocators at the same time. Disabling is done by free_all_bootmem on UMA systems and by free_all_bootmem_node on NUMA systems. Both need to be invoked by the architecture-specific initialization code after the buddy system has been set up.

The page bitmap of the bootmem allocator is first scanned, and every unused page is freed. The interface to the buddy system is the_free_pages_bootmem function that is invoked for each freed page. The function relies internally on the standard function_free_page. It enables the pages to be incorporated in the data structures of the buddy system, where they are managed as free pages and are available for allocation.

Once the page bitmap has been fully scanned, the memory space it occupies must also be removed. Thereafter, only the buddy system can be used for memory allocation.

Continue reading here: Releasing Initialization Data

Was this article helpful?

0 0