aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cpusets.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/cpusets.txt')
-rw-r--r--Documentation/cpusets.txt41
1 files changed, 14 insertions, 27 deletions
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index 990998ee10b6..30c41459953c 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -4,8 +4,9 @@
4Copyright (C) 2004 BULL SA. 4Copyright (C) 2004 BULL SA.
5Written by Simon.Derr@bull.net 5Written by Simon.Derr@bull.net
6 6
7Portions Copyright (c) 2004 Silicon Graphics, Inc. 7Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
8Modified by Paul Jackson <pj@sgi.com> 8Modified by Paul Jackson <pj@sgi.com>
9Modified by Christoph Lameter <clameter@sgi.com>
9 10
10CONTENTS: 11CONTENTS:
11========= 12=========
@@ -90,7 +91,8 @@ This can be especially valuable on:
90 91
91These subsets, or "soft partitions" must be able to be dynamically 92These subsets, or "soft partitions" must be able to be dynamically
92adjusted, as the job mix changes, without impacting other concurrently 93adjusted, as the job mix changes, without impacting other concurrently
93executing jobs. 94executing jobs. The location of the running jobs pages may also be moved
95when the memory locations are changed.
94 96
95The kernel cpuset patch provides the minimum essential kernel 97The kernel cpuset patch provides the minimum essential kernel
96mechanisms required to efficiently implement such subsets. It 98mechanisms required to efficiently implement such subsets. It
@@ -102,8 +104,8 @@ memory allocator code.
1021.3 How are cpusets implemented ? 1041.3 How are cpusets implemented ?
103--------------------------------- 105---------------------------------
104 106
105Cpusets provide a Linux kernel (2.6.7 and above) mechanism to constrain 107Cpusets provide a Linux kernel mechanism to constrain which CPUs and
106which CPUs and Memory Nodes are used by a process or set of processes. 108Memory Nodes are used by a process or set of processes.
107 109
108The Linux kernel already has a pair of mechanisms to specify on which 110The Linux kernel already has a pair of mechanisms to specify on which
109CPUs a task may be scheduled (sched_setaffinity) and on which Memory 111CPUs a task may be scheduled (sched_setaffinity) and on which Memory
@@ -371,22 +373,17 @@ cpusets memory placement policy 'mems' subsequently changes.
371If the cpuset flag file 'memory_migrate' is set true, then when 373If the cpuset flag file 'memory_migrate' is set true, then when
372tasks are attached to that cpuset, any pages that task had 374tasks are attached to that cpuset, any pages that task had
373allocated to it on nodes in its previous cpuset are migrated 375allocated to it on nodes in its previous cpuset are migrated
374to the tasks new cpuset. Depending on the implementation, 376to the tasks new cpuset. The relative placement of the page within
375this migration may either be done by swapping the page out, 377the cpuset is preserved during these migration operations if possible.
376so that the next time the page is referenced, it will be paged 378For example if the page was on the second valid node of the prior cpuset
377into the tasks new cpuset, usually on the node where it was 379then the page will be placed on the second valid node of the new cpuset.
378referenced, or this migration may be done by directly copying 380
379the pages from the tasks previous cpuset to the new cpuset,
380where possible to the same node, relative to the new cpuset,
381as the node that held the page, relative to the old cpuset.
382Also if 'memory_migrate' is set true, then if that cpusets 381Also if 'memory_migrate' is set true, then if that cpusets
383'mems' file is modified, pages allocated to tasks in that 382'mems' file is modified, pages allocated to tasks in that
384cpuset, that were on nodes in the previous setting of 'mems', 383cpuset, that were on nodes in the previous setting of 'mems',
385will be moved to nodes in the new setting of 'mems.' Again, 384will be moved to nodes in the new setting of 'mems.'
386depending on the implementation, this might be done by swapping, 385Pages that were not in the tasks prior cpuset, or in the cpusets
387or by direct copying. In either case, pages that were not in 386prior 'mems' setting, will not be moved.
388the tasks prior cpuset, or in the cpusets prior 'mems' setting,
389will not be moved.
390 387
391There is an exception to the above. If hotplug functionality is used 388There is an exception to the above. If hotplug functionality is used
392to remove all the CPUs that are currently assigned to a cpuset, 389to remove all the CPUs that are currently assigned to a cpuset,
@@ -434,16 +431,6 @@ and then start a subshell 'sh' in that cpuset:
434 # The next line should display '/Charlie' 431 # The next line should display '/Charlie'
435 cat /proc/self/cpuset 432 cat /proc/self/cpuset
436 433
437In the case that a change of cpuset includes wanting to move already
438allocated memory pages, consider further the work of IWAMOTO
439Toshihiro <iwamoto@valinux.co.jp> for page remapping and memory
440hotremoval, which can be found at:
441
442 http://people.valinux.co.jp/~iwamoto/mh.html
443
444The integration of cpusets with such memory migration is not yet
445available.
446
447In the future, a C library interface to cpusets will likely be 434In the future, a C library interface to cpusets will likely be
448available. For now, the only way to query or modify cpusets is 435available. For now, the only way to query or modify cpusets is
449via the cpuset file system, using the various cd, mkdir, echo, cat, 436via the cpuset file system, using the various cd, mkdir, echo, cat,