Include page migration if the system is NUMA or having a memory model that
allows distinct areas of memory (SPARSEMEM, DISCONTIGMEM).
And:
- Only include lru_add_drain_per_cpu if building for an SMP system.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
extern int isolate_lru_page(struct page *p);
extern int putback_lru_pages(struct list_head *l);
extern int isolate_lru_page(struct page *p);
extern int putback_lru_pages(struct list_head *l);
extern int migrate_pages(struct list_head *l, struct list_head *t);
extern int migrate_pages(struct list_head *l, struct list_head *t);
#ifdef CONFIG_MMU
/* linux/mm/shmem.c */
#ifdef CONFIG_MMU
/* linux/mm/shmem.c */
default "4096" if ARM && !CPU_CACHE_VIPT
default "4096" if PARISC && !PA20
default "4"
default "4096" if ARM && !CPU_CACHE_VIPT
default "4096" if PARISC && !PA20
default "4"
+
+#
+# support for page migration
+#
+config MIGRATION
+ def_bool y if NUMA || SPARSEMEM || DISCONTIGMEM
+ depends on SWAP
/*
* swapout a single page
* page is locked upon entry, unlocked on exit
/*
* swapout a single page
* page is locked upon entry, unlocked on exit
/*
* Skip locked pages during the first two passes to give the
/*
* Skip locked pages during the first two passes to give the
- * functions holding the lock time to release the page. Later we use
- * lock_page to have a higher chance of acquiring the lock.
+ * functions holding the lock time to release the page. Later we
+ * use lock_page() to have a higher chance of acquiring the
+ * lock.
*/
if (pass > 2)
lock_page(page);
*/
if (pass > 2)
lock_page(page);
* Only wait on writeback if we have already done a pass where
* we we may have triggered writeouts for lots of pages.
*/
* Only wait on writeback if we have already done a pass where
* we we may have triggered writeouts for lots of pages.
*/
wait_on_page_writeback(page);
wait_on_page_writeback(page);
if (PageWriteback(page)) {
unlock_page(page);
goto retry_later;
}
if (PageWriteback(page)) {
unlock_page(page);
goto retry_later;
}
if (PageAnon(page) && !PageSwapCache(page)) {
if (!add_to_swap(page)) {
unlock_page(page);
if (PageAnon(page) && !PageSwapCache(page)) {
if (!add_to_swap(page)) {
unlock_page(page);
-#endif /* CONFIG_SWAP */
/*
* Page is properly locked and writeback is complete.
* Try to migrate the page.
*/
/*
* Page is properly locked and writeback is complete.
* Try to migrate the page.
*/
+ if (!swap_page(page))
+ continue;
}
if (retry && pass++ < 10)
goto redo;
}
if (retry && pass++ < 10)
goto redo;
return nr_failed + retry;
}
return nr_failed + retry;
}
/*
* zone->lru_lock is heavily contended. Some of the functions that
/*
* zone->lru_lock is heavily contended. Some of the functions that