aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2006-01-08 04:00:56 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:12:43 -0500
commit45b07ef31d1182d2cfde7711327e3afb268bb1ac (patch)
tree3bf820531f920b43d4ed963643b1f565c82bcaa4 /Documentation
parentd0d963281ccb22e6f339bfdd75c6b2e31351929f (diff)
[PATCH] cpusets: swap migration interface
Add a boolean "memory_migrate" to each cpuset, represented by a file containing "0" or "1" in each directory below /dev/cpuset. It defaults to false (file contains "0"). It can be set true by writing "1" to the file. If true, then anytime that a task is attached to the cpuset so marked, the pages of that task will be moved to that cpuset, preserving, to the extent practical, the cpuset-relative placement of the pages. Also anytime that a cpuset so marked has its memory placement changed (by writing to its "mems" file), the tasks in that cpuset will have their pages moved to the cpusets new nodes, preserving, to the extent practical, the cpuset-relative placement of the moved pages. Signed-off-by: Paul Jackson <pj@sgi.com> Cc: Christoph Lameter <christoph@lameter.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/cpusets.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index a09a8eb80665..e2d9afc30d2d 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -192,6 +192,7 @@ containing the following files describing that cpuset:
192 192
193 - cpus: list of CPUs in that cpuset 193 - cpus: list of CPUs in that cpuset
194 - mems: list of Memory Nodes in that cpuset 194 - mems: list of Memory Nodes in that cpuset
195 - memory_migrate flag: if set, move pages to cpusets nodes
195 - cpu_exclusive flag: is cpu placement exclusive? 196 - cpu_exclusive flag: is cpu placement exclusive?
196 - mem_exclusive flag: is memory placement exclusive? 197 - mem_exclusive flag: is memory placement exclusive?
197 - tasks: list of tasks (by pid) attached to that cpuset 198 - tasks: list of tasks (by pid) attached to that cpuset
@@ -277,6 +278,30 @@ rewritten to the 'tasks' file of its cpuset. This is done to avoid
277impacting the scheduler code in the kernel with a check for changes 278impacting the scheduler code in the kernel with a check for changes
278in a tasks processor placement. 279in a tasks processor placement.
279 280
281Normally, once a page is allocated (given a physical page
282of main memory) then that page stays on whatever node it
283was allocated, so long as it remains allocated, even if the
284cpusets memory placement policy 'mems' subsequently changes.
285If the cpuset flag file 'memory_migrate' is set true, then when
286tasks are attached to that cpuset, any pages that task had
287allocated to it on nodes in its previous cpuset are migrated
288to the tasks new cpuset. Depending on the implementation,
289this migration may either be done by swapping the page out,
290so that the next time the page is referenced, it will be paged
291into the tasks new cpuset, usually on the node where it was
292referenced, or this migration may be done by directly copying
293the pages from the tasks previous cpuset to the new cpuset,
294where possible to the same node, relative to the new cpuset,
295as the node that held the page, relative to the old cpuset.
296Also if 'memory_migrate' is set true, then if that cpusets
297'mems' file is modified, pages allocated to tasks in that
298cpuset, that were on nodes in the previous setting of 'mems',
299will be moved to nodes in the new setting of 'mems.' Again,
300depending on the implementation, this might be done by swapping,
301or by direct copying. In either case, pages that were not in
302the tasks prior cpuset, or in the cpusets prior 'mems' setting,
303will not be moved.
304
280There is an exception to the above. If hotplug functionality is used 305There is an exception to the above. If hotplug functionality is used
281to remove all the CPUs that are currently assigned to a cpuset, 306to remove all the CPUs that are currently assigned to a cpuset,
282then the kernel will automatically update the cpus_allowed of all 307then the kernel will automatically update the cpus_allowed of all