diff options
author | Lee Schermerhorn <lee.schermerhorn@hp.com> | 2008-10-18 23:26:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:31 -0400 |
commit | af936a1606246a10c145feac3770f6287f483f02 (patch) | |
tree | 8b1ca7fabb5c749ffdecd654519889c6c2ed2fb6 /include | |
parent | 64d6519dda3905dfb94d3f93c07c5f263f41813f (diff) |
vmscan: unevictable LRU scan sysctl
This patch adds a function to scan individual or all zones' unevictable
lists and move any pages that have become evictable onto the respective
zone's inactive list, where shrink_inactive_list() will deal with them.
Adds sysctl to scan all nodes, and per node attributes to individual
nodes' zones.
Kosaki: If evictable page found in unevictable lru when write
/proc/sys/vm/scan_unevictable_pages, print filename and file offset of
these pages.
[akpm@linux-foundation.org: fix one CONFIG_MMU=n build error]
[kosaki.motohiro@jp.fujitsu.com: adapt vmscan-unevictable-lru-scan-sysctl.patch to new sysfs API]
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/rmap.h | 3 | ||||
-rw-r--r-- | include/linux/swap.h | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 955667e6a52d..1da48db8db09 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -75,6 +75,9 @@ void anon_vma_unlink(struct vm_area_struct *); | |||
75 | void anon_vma_link(struct vm_area_struct *); | 75 | void anon_vma_link(struct vm_area_struct *); |
76 | void __anon_vma_link(struct vm_area_struct *); | 76 | void __anon_vma_link(struct vm_area_struct *); |
77 | 77 | ||
78 | extern struct anon_vma *page_lock_anon_vma(struct page *page); | ||
79 | extern void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
80 | |||
78 | /* | 81 | /* |
79 | * rmap interfaces called when adding or removing pte of page | 82 | * rmap interfaces called when adding or removing pte of page |
80 | */ | 83 | */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 07eda69412fb..a3af95b2cb6d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/memcontrol.h> | 8 | #include <linux/memcontrol.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/node.h> | ||
10 | 11 | ||
11 | #include <asm/atomic.h> | 12 | #include <asm/atomic.h> |
12 | #include <asm/page.h> | 13 | #include <asm/page.h> |
@@ -235,15 +236,29 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
235 | #ifdef CONFIG_UNEVICTABLE_LRU | 236 | #ifdef CONFIG_UNEVICTABLE_LRU |
236 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | 237 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); |
237 | extern void scan_mapping_unevictable_pages(struct address_space *); | 238 | extern void scan_mapping_unevictable_pages(struct address_space *); |
239 | |||
240 | extern unsigned long scan_unevictable_pages; | ||
241 | extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | ||
242 | void __user *, size_t *, loff_t *); | ||
243 | extern int scan_unevictable_register_node(struct node *node); | ||
244 | extern void scan_unevictable_unregister_node(struct node *node); | ||
238 | #else | 245 | #else |
239 | static inline int page_evictable(struct page *page, | 246 | static inline int page_evictable(struct page *page, |
240 | struct vm_area_struct *vma) | 247 | struct vm_area_struct *vma) |
241 | { | 248 | { |
242 | return 1; | 249 | return 1; |
243 | } | 250 | } |
251 | |||
244 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) | 252 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) |
245 | { | 253 | { |
246 | } | 254 | } |
255 | |||
256 | static inline int scan_unevictable_register_node(struct node *node) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline void scan_unevictable_unregister_node(struct node *node) { } | ||
247 | #endif | 262 | #endif |
248 | 263 | ||
249 | extern int kswapd_run(int nid); | 264 | extern int kswapd_run(int nid); |