aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-01-08 04:00:48 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:12:41 -0500
commit49d2e9cc4544369635cd6f4ef6d5bb0f757079a7 (patch)
treed8c76c5224b05b812f96424a18b1e9205d90feae /include/linux/swap.h
parent930d915252edda7042c944ed3c30194a2f9fe163 (diff)
[PATCH] Swap Migration V5: migrate_pages() function
This adds the basic page migration function with a minimal implementation that only allows the eviction of pages to swap space. Page eviction and migration may be useful to migrate pages, to suspend programs or for remapping single pages (useful for faulty pages or pages with soft ECC failures) The process is as follows: The function wanting to migrate pages must first build a list of pages to be migrated or evicted and take them off the lru lists via isolate_lru_page(). isolate_lru_page determines that a page is freeable based on the LRU bit set. Then the actual migration or swapout can happen by calling migrate_pages(). migrate_pages does its best to migrate or swapout the pages and does multiple passes over the list. Some pages may only be swappable if they are not dirty. migrate_pages may start writing out dirty pages in the initial passes over the pages. However, migrate_pages may not be able to migrate or evict all pages for a variety of reasons. The remaining pages may be returned to the LRU lists using putback_lru_pages(). Changelog V4->V5: - Use the lru caches to return pages to the LRU Changelog V3->V4: - Restructure code so that applying patches to support full migration does require minimal changes. Rename swapout_pages() to migrate_pages(). Changelog V2->V3: - Extract common code from shrink_list() and swapout_pages() Signed-off-by: Mike Kravetz <kravetz@us.ibm.com> Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: "Michael Kerrisk" <mtk-manpages@gmx.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a49112536c02..893096e67bdb 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -178,6 +178,8 @@ extern int vm_swappiness;
178extern int isolate_lru_page(struct page *p); 178extern int isolate_lru_page(struct page *p);
179extern int putback_lru_pages(struct list_head *l); 179extern int putback_lru_pages(struct list_head *l);
180 180
181extern int migrate_pages(struct list_head *l, struct list_head *t);
182
181#ifdef CONFIG_MMU 183#ifdef CONFIG_MMU
182/* linux/mm/shmem.c */ 184/* linux/mm/shmem.c */
183extern int shmem_unuse(swp_entry_t entry, struct page *page); 185extern int shmem_unuse(swp_entry_t entry, struct page *page);