diff options
Diffstat (limited to 'Documentation/vm')
-rw-r--r-- | Documentation/vm/page_migration | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration index 0a5d5fb18854..99f89aa10169 100644 --- a/Documentation/vm/page_migration +++ b/Documentation/vm/page_migration | |||
@@ -26,8 +26,13 @@ a process are located. See also the numa_maps manpage in the numactl package. | |||
26 | Manual migration is useful if for example the scheduler has relocated | 26 | Manual migration is useful if for example the scheduler has relocated |
27 | a process to a processor on a distant node. A batch scheduler or an | 27 | a process to a processor on a distant node. A batch scheduler or an |
28 | administrator may detect the situation and move the pages of the process | 28 | administrator may detect the situation and move the pages of the process |
29 | nearer to the new processor. At some point in the future we may have | 29 | nearer to the new processor. The kernel itself does only provide |
30 | some mechanism in the scheduler that will automatically move the pages. | 30 | manual page migration support. Automatic page migration may be implemented |
31 | through user space processes that move pages. A special function call | ||
32 | "move_pages" allows the moving of individual pages within a process. | ||
33 | A NUMA profiler may f.e. obtain a log showing frequent off node | ||
34 | accesses and may use the result to move pages to more advantageous | ||
35 | locations. | ||
31 | 36 | ||
32 | Larger installations usually partition the system using cpusets into | 37 | Larger installations usually partition the system using cpusets into |
33 | sections of nodes. Paul Jackson has equipped cpusets with the ability to | 38 | sections of nodes. Paul Jackson has equipped cpusets with the ability to |
@@ -62,22 +67,14 @@ A. In kernel use of migrate_pages() | |||
62 | It also prevents the swapper or other scans to encounter | 67 | It also prevents the swapper or other scans to encounter |
63 | the page. | 68 | the page. |
64 | 69 | ||
65 | 2. Generate a list of newly allocates pages. These pages will contain the | 70 | 2. We need to have a function of type new_page_t that can be |
66 | contents of the pages from the first list after page migration is | 71 | passed to migrate_pages(). This function should figure out |
67 | complete. | 72 | how to allocate the correct new page given the old page. |
68 | 73 | ||
69 | 3. The migrate_pages() function is called which attempts | 74 | 3. The migrate_pages() function is called which attempts |
70 | to do the migration. It returns the moved pages in the | 75 | to do the migration. It will call the function to allocate |
71 | list specified as the third parameter and the failed | 76 | the new page for each page that is considered for |
72 | migrations in the fourth parameter. When the function | 77 | moving. |
73 | returns the first list will contain the pages that could still be retried. | ||
74 | |||
75 | 4. The leftover pages of various types are returned | ||
76 | to the LRU using putback_to_lru_pages() or otherwise | ||
77 | disposed of. The pages will still have the refcount as | ||
78 | increased by isolate_lru_pages() if putback_to_lru_pages() is not | ||
79 | used! The kernel may want to handle the various cases of failures in | ||
80 | different ways. | ||
81 | 78 | ||
82 | B. How migrate_pages() works | 79 | B. How migrate_pages() works |
83 | ---------------------------- | 80 | ---------------------------- |