hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/core-api/boot-time-mm.rst
....@@ -5,54 +5,23 @@
55 Early system initialization cannot use "normal" memory management
66 simply because it is not set up yet. But there is still need to
77 allocate memory for various data structures, for instance for the
8
-physical page allocator. To address this, a specialized allocator
9
-called the :ref:`Boot Memory Allocator <bootmem>`, or bootmem, was
10
-introduced. Several years later PowerPC developers added a "Logical
11
-Memory Blocks" allocator, which was later adopted by other
12
-architectures and renamed to :ref:`memblock <memblock>`. There is also
13
-a compatibility layer called `nobootmem` that translates bootmem
14
-allocation interfaces to memblock calls.
8
+physical page allocator.
159
16
-The selection of the early allocator is done using
17
-``CONFIG_NO_BOOTMEM`` and ``CONFIG_HAVE_MEMBLOCK`` kernel
18
-configuration options. These options are enabled or disabled
19
-statically by the architectures' Kconfig files.
20
-
21
-* Architectures that rely only on bootmem select
22
- ``CONFIG_NO_BOOTMEM=n && CONFIG_HAVE_MEMBLOCK=n``.
23
-* The users of memblock with the nobootmem compatibility layer set
24
- ``CONFIG_NO_BOOTMEM=y && CONFIG_HAVE_MEMBLOCK=y``.
25
-* And for those that use both memblock and bootmem the configuration
26
- includes ``CONFIG_NO_BOOTMEM=n && CONFIG_HAVE_MEMBLOCK=y``.
27
-
28
-Whichever allocator is used, it is the responsibility of the
29
-architecture specific initialization to set it up in
30
-:c:func:`setup_arch` and tear it down in :c:func:`mem_init` functions.
10
+A specialized allocator called ``memblock`` performs the
11
+boot time memory management. The architecture specific initialization
12
+must set it up in :c:func:`setup_arch` and tear it down in
13
+:c:func:`mem_init` functions.
3114
3215 Once the early memory management is available it offers a variety of
3316 functions and macros for memory allocations. The allocation request
3417 may be directed to the first (and probably the only) node or to a
3518 particular node in a NUMA system. There are API variants that panic
36
-when an allocation fails and those that don't. And more recent and
37
-advanced memblock even allows controlling its own behaviour.
19
+when an allocation fails and those that don't.
3820
39
-.. _bootmem:
21
+Memblock also offers a variety of APIs that control its own behaviour.
4022
41
-Bootmem
42
-=======
43
-
44
-(mostly stolen from Mel Gorman's "Understanding the Linux Virtual
45
-Memory Manager" `book`_)
46
-
47
-.. _book: https://www.kernel.org/doc/gorman/
48
-
49
-.. kernel-doc:: mm/bootmem.c
50
- :doc: bootmem overview
51
-
52
-.. _memblock:
53
-
54
-Memblock
55
-========
23
+Memblock Overview
24
+=================
5625
5726 .. kernel-doc:: mm/memblock.c
5827 :doc: memblock overview
....@@ -60,26 +29,6 @@
6029
6130 Functions and structures
6231 ========================
63
-
64
-Common API
65
-----------
66
-
67
-The functions that are described in this section are available
68
-regardless of what early memory manager is enabled.
69
-
70
-.. kernel-doc:: mm/nobootmem.c
71
-
72
-Bootmem specific API
73
---------------------
74
-
75
-These interfaces available only with bootmem, i.e when ``CONFIG_NO_BOOTMEM=n``
76
-
77
-.. kernel-doc:: include/linux/bootmem.h
78
-.. kernel-doc:: mm/bootmem.c
79
- :nodocs:
80
-
81
-Memblock specific API
82
----------------------
8332
8433 Here is the description of memblock data structures, functions and
8534 macros. Some of them are actually internal, but since they are
....@@ -89,4 +38,4 @@
8938
9039 .. kernel-doc:: include/linux/memblock.h
9140 .. kernel-doc:: mm/memblock.c
92
- :nodocs:
41
+ :functions: