diff options
Diffstat (limited to 'Documentation/vm')
-rw-r--r-- | Documentation/vm/numa_memory_policy.txt | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index 6719d642653f..13cca5a3cf17 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt | |||
@@ -147,35 +147,18 @@ Components of Memory Policies | |||
147 | 147 | ||
148 | Linux memory policy supports the following 4 behavioral modes: | 148 | Linux memory policy supports the following 4 behavioral modes: |
149 | 149 | ||
150 | Default Mode--MPOL_DEFAULT: The behavior specified by this mode is | 150 | Default Mode--MPOL_DEFAULT: This mode is only used in the memory |
151 | context or scope dependent. | 151 | policy APIs. Internally, MPOL_DEFAULT is converted to the NULL |
152 | 152 | memory policy in all policy scopes. Any existing non-default policy | |
153 | As mentioned in the Policy Scope section above, during normal | 153 | will simply be removed when MPOL_DEFAULT is specified. As a result, |
154 | system operation, the System Default Policy is hard coded to | 154 | MPOL_DEFAULT means "fall back to the next most specific policy scope." |
155 | contain the Default mode. | 155 | |
156 | 156 | For example, a NULL or default task policy will fall back to the | |
157 | In this context, default mode means "local" allocation--that is | 157 | system default policy. A NULL or default vma policy will fall |
158 | attempt to allocate the page from the node associated with the cpu | 158 | back to the task policy. |
159 | where the fault occurs. If the "local" node has no memory, or the | 159 | |
160 | node's memory can be exhausted [no free pages available], local | 160 | When specified in one of the memory policy APIs, the Default mode |
161 | allocation will "fallback to"--attempt to allocate pages from-- | 161 | does not use the optional set of nodes. |
162 | "nearby" nodes, in order of increasing "distance". | ||
163 | |||
164 | Implementation detail -- subject to change: "Fallback" uses | ||
165 | a per node list of sibling nodes--called zonelists--built at | ||
166 | boot time, or when nodes or memory are added or removed from | ||
167 | the system [memory hotplug]. These per node zonelist are | ||
168 | constructed with nodes in order of increasing distance based | ||
169 | on information provided by the platform firmware. | ||
170 | |||
171 | When a task/process policy or a shared policy contains the Default | ||
172 | mode, this also means "local allocation", as described above. | ||
173 | |||
174 | In the context of a VMA, Default mode means "fall back to task | ||
175 | policy"--which may or may not specify Default mode. Thus, Default | ||
176 | mode can not be counted on to mean local allocation when used | ||
177 | on a non-shared region of the address space. However, see | ||
178 | MPOL_PREFERRED below. | ||
179 | 162 | ||
180 | It is an error for the set of nodes specified for this policy to | 163 | It is an error for the set of nodes specified for this policy to |
181 | be non-empty. | 164 | be non-empty. |
@@ -187,19 +170,18 @@ Components of Memory Policies | |||
187 | 170 | ||
188 | MPOL_PREFERRED: This mode specifies that the allocation should be | 171 | MPOL_PREFERRED: This mode specifies that the allocation should be |
189 | attempted from the single node specified in the policy. If that | 172 | attempted from the single node specified in the policy. If that |
190 | allocation fails, the kernel will search other nodes, exactly as | 173 | allocation fails, the kernel will search other nodes, in order of |
191 | it would for a local allocation that started at the preferred node | 174 | increasing distance from the preferred node based on information |
192 | in increasing distance from the preferred node. "Local" allocation | 175 | provided by the platform firmware. |
193 | policy can be viewed as a Preferred policy that starts at the node | ||
194 | containing the cpu where the allocation takes place. | 176 | containing the cpu where the allocation takes place. |
195 | 177 | ||
196 | Internally, the Preferred policy uses a single node--the | 178 | Internally, the Preferred policy uses a single node--the |
197 | preferred_node member of struct mempolicy. A "distinguished | 179 | preferred_node member of struct mempolicy. A "distinguished |
198 | value of this preferred_node, currently '-1', is interpreted | 180 | value of this preferred_node, currently '-1', is interpreted |
199 | as "the node containing the cpu where the allocation takes | 181 | as "the node containing the cpu where the allocation takes |
200 | place"--local allocation. This is the way to specify | 182 | place"--local allocation. "Local" allocation policy can be |
201 | local allocation for a specific range of addresses--i.e. for | 183 | viewed as a Preferred policy that starts at the node containing |
202 | VMA policies. | 184 | the cpu where the allocation takes place. |
203 | 185 | ||
204 | It is possible for the user to specify that local allocation is | 186 | It is possible for the user to specify that local allocation is |
205 | always preferred by passing an empty nodemask with this mode. | 187 | always preferred by passing an empty nodemask with this mode. |