@@ -14,15 +14,11 @@ for the CPU. Then there could be several contiguous ranges at
14
14
completely distinct addresses. And, don't forget about NUMA, where
15
15
different memory banks are attached to different CPUs.
16
16
17
- Linux abstracts this diversity using one of the three memory models:
18
- FLATMEM, DISCONTIGMEM and SPARSEMEM. Each architecture defines what
17
+ Linux abstracts this diversity using one of the two memory models:
18
+ FLATMEM and SPARSEMEM. Each architecture defines what
19
19
memory models it supports, what the default memory model is and
20
20
whether it is possible to manually override that default.
21
21
22
- .. note ::
23
- At time of this writing, DISCONTIGMEM is considered deprecated,
24
- although it is still in use by several architectures.
25
-
26
22
All the memory models track the status of physical page frames using
27
23
struct page arranged in one or more arrays.
28
24
@@ -63,43 +59,6 @@ straightforward: `PFN - ARCH_PFN_OFFSET` is an index to the
63
59
The `ARCH_PFN_OFFSET ` defines the first page frame number for
64
60
systems with physical memory starting at address different from 0.
65
61
66
- DISCONTIGMEM
67
- ============
68
-
69
- The DISCONTIGMEM model treats the physical memory as a collection of
70
- `nodes ` similarly to how Linux NUMA support does. For each node Linux
71
- constructs an independent memory management subsystem represented by
72
- `struct pglist_data ` (or `pg_data_t ` for short). Among other
73
- things, `pg_data_t ` holds the `node_mem_map ` array that maps
74
- physical pages belonging to that node. The `node_start_pfn ` field of
75
- `pg_data_t ` is the number of the first page frame belonging to that
76
- node.
77
-
78
- The architecture setup code should call :c:func: `free_area_init_node ` for
79
- each node in the system to initialize the `pg_data_t ` object and its
80
- `node_mem_map `.
81
-
82
- Every `node_mem_map ` behaves exactly as FLATMEM's `mem_map ` -
83
- every physical page frame in a node has a `struct page ` entry in the
84
- `node_mem_map ` array. When DISCONTIGMEM is enabled, a portion of the
85
- `flags ` field of the `struct page ` encodes the node number of the
86
- node hosting that page.
87
-
88
- The conversion between a PFN and the `struct page ` in the
89
- DISCONTIGMEM model became slightly more complex as it has to determine
90
- which node hosts the physical page and which `pg_data_t ` object
91
- holds the `struct page `.
92
-
93
- Architectures that support DISCONTIGMEM provide :c:func: `pfn_to_nid `
94
- to convert PFN to the node number. The opposite conversion helper
95
- :c:func: `page_to_nid ` is generic as it uses the node number encoded in
96
- page->flags.
97
-
98
- Once the node number is known, the PFN can be used to index
99
- appropriate `node_mem_map ` array to access the `struct page ` and
100
- the offset of the `struct page ` from the `node_mem_map ` plus
101
- `node_start_pfn ` is the PFN of that page.
102
-
103
62
SPARSEMEM
104
63
=========
105
64
0 commit comments