blob: e5ec9f1a563dfc9f009dd47f679fc6a74f1f349e [file] [log] [blame]
Mike Rapoportae9d8842018-06-30 17:55:06 +03001===========================
2Boot time memory management
3===========================
4
5Early system initialization cannot use "normal" memory management
6simply because it is not set up yet. But there is still need to
7allocate memory for various data structures, for instance for the
Mike Rapoport530d4c02018-10-30 15:09:54 -07008physical page allocator.
Mike Rapoportae9d8842018-06-30 17:55:06 +03009
Mike Rapoport530d4c02018-10-30 15:09:54 -070010A specialized allocator called ``memblock`` performs the
11boot time memory management. The architecture specific initialization
12must set it up in :c:func:`setup_arch` and tear it down in
13:c:func:`mem_init` functions.
Mike Rapoportae9d8842018-06-30 17:55:06 +030014
15Once the early memory management is available it offers a variety of
16functions and macros for memory allocations. The allocation request
17may be directed to the first (and probably the only) node or to a
18particular node in a NUMA system. There are API variants that panic
Mike Rapoport530d4c02018-10-30 15:09:54 -070019when an allocation fails and those that don't.
Mike Rapoportae9d8842018-06-30 17:55:06 +030020
Mike Rapoport530d4c02018-10-30 15:09:54 -070021Memblock also offers a variety of APIs that control its own behaviour.
Mike Rapoportae9d8842018-06-30 17:55:06 +030022
Mike Rapoport530d4c02018-10-30 15:09:54 -070023Memblock Overview
24=================
Mike Rapoportae9d8842018-06-30 17:55:06 +030025
26.. kernel-doc:: mm/memblock.c
27 :doc: memblock overview
28
29
30Functions and structures
31========================
32
Mike Rapoportae9d8842018-06-30 17:55:06 +030033Here is the description of memblock data structures, functions and
34macros. Some of them are actually internal, but since they are
35documented it would be silly to omit them. Besides, reading the
36descriptions for the internal functions can help to understand what
37really happens under the hood.
38
39.. kernel-doc:: include/linux/memblock.h
40.. kernel-doc:: mm/memblock.c
Mike Rapoportad98b602018-09-11 19:24:11 +030041 :functions: