18c2ecf20Sopenharmony_ci=========================== 28c2ecf20Sopenharmony_ciBoot time memory management 38c2ecf20Sopenharmony_ci=========================== 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciEarly system initialization cannot use "normal" memory management 68c2ecf20Sopenharmony_cisimply because it is not set up yet. But there is still need to 78c2ecf20Sopenharmony_ciallocate memory for various data structures, for instance for the 88c2ecf20Sopenharmony_ciphysical page allocator. 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciA specialized allocator called ``memblock`` performs the 118c2ecf20Sopenharmony_ciboot time memory management. The architecture specific initialization 128c2ecf20Sopenharmony_cimust set it up in :c:func:`setup_arch` and tear it down in 138c2ecf20Sopenharmony_ci:c:func:`mem_init` functions. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciOnce the early memory management is available it offers a variety of 168c2ecf20Sopenharmony_cifunctions and macros for memory allocations. The allocation request 178c2ecf20Sopenharmony_cimay be directed to the first (and probably the only) node or to a 188c2ecf20Sopenharmony_ciparticular node in a NUMA system. There are API variants that panic 198c2ecf20Sopenharmony_ciwhen an allocation fails and those that don't. 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciMemblock also offers a variety of APIs that control its own behaviour. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciMemblock Overview 248c2ecf20Sopenharmony_ci================= 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci.. kernel-doc:: mm/memblock.c 278c2ecf20Sopenharmony_ci :doc: memblock overview 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciFunctions and structures 318c2ecf20Sopenharmony_ci======================== 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciHere is the description of memblock data structures, functions and 348c2ecf20Sopenharmony_cimacros. Some of them are actually internal, but since they are 358c2ecf20Sopenharmony_cidocumented it would be silly to omit them. Besides, reading the 368c2ecf20Sopenharmony_cidescriptions for the internal functions can help to understand what 378c2ecf20Sopenharmony_cireally happens under the hood. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci.. kernel-doc:: include/linux/memblock.h 408c2ecf20Sopenharmony_ci.. kernel-doc:: mm/memblock.c 418c2ecf20Sopenharmony_ci :functions: 42