migrate.c (3fe2011ff51e92500010a495df4be86745fbbda9) | migrate.c (748446bb6b5a9390b546af38ec899c868a9dbcf0) |
---|---|
1/* 2 * Memory Migration functionality - linux/mm/migration.c 3 * 4 * Copyright (C) 2006 Silicon Graphics, Inc., Christoph Lameter 5 * 6 * Page migration was first developed in the context of the memory hotplug 7 * project. The main authors of the migration code are: 8 * --- 26 unchanged lines hidden (view full) --- 35#include <linux/gfp.h> 36 37#include "internal.h" 38 39#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru)) 40 41/* 42 * migrate_prep() needs to be called before we start compiling a list of pages | 1/* 2 * Memory Migration functionality - linux/mm/migration.c 3 * 4 * Copyright (C) 2006 Silicon Graphics, Inc., Christoph Lameter 5 * 6 * Page migration was first developed in the context of the memory hotplug 7 * project. The main authors of the migration code are: 8 * --- 26 unchanged lines hidden (view full) --- 35#include <linux/gfp.h> 36 37#include "internal.h" 38 39#define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru)) 40 41/* 42 * migrate_prep() needs to be called before we start compiling a list of pages |
43 * to be migrated using isolate_lru_page(). | 43 * to be migrated using isolate_lru_page(). If scheduling work on other CPUs is 44 * undesirable, use migrate_prep_local() |
44 */ 45int migrate_prep(void) 46{ 47 /* 48 * Clear the LRU lists so pages can be isolated. 49 * Note that pages may be moved off the LRU after we have 50 * drained them. Those pages will fail to migrate like other 51 * pages that may be busy. 52 */ 53 lru_add_drain_all(); 54 55 return 0; 56} 57 | 45 */ 46int migrate_prep(void) 47{ 48 /* 49 * Clear the LRU lists so pages can be isolated. 50 * Note that pages may be moved off the LRU after we have 51 * drained them. Those pages will fail to migrate like other 52 * pages that may be busy. 53 */ 54 lru_add_drain_all(); 55 56 return 0; 57} 58 |
59/* Do the necessary work of migrate_prep but not if it involves other CPUs */ 60int migrate_prep_local(void) 61{ 62 lru_add_drain(); 63 64 return 0; 65} 66 |
|
58/* 59 * Add isolated pages on the list back to the LRU under page lock 60 * to avoid leaking evictable pages back onto unevictable list. 61 */ 62void putback_lru_pages(struct list_head *l) 63{ 64 struct page *page; 65 struct page *page2; --- 1084 unchanged lines hidden --- | 67/* 68 * Add isolated pages on the list back to the LRU under page lock 69 * to avoid leaking evictable pages back onto unevictable list. 70 */ 71void putback_lru_pages(struct list_head *l) 72{ 73 struct page *page; 74 struct page *page2; --- 1084 unchanged lines hidden --- |