aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorLee Schermerhorn <lee.schermerhorn@hp.com>2008-10-18 23:26:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 11:52:31 -0400
commitaf936a1606246a10c145feac3770f6287f483f02 (patch)
tree8b1ca7fabb5c749ffdecd654519889c6c2ed2fb6 /include/linux/swap.h
parent64d6519dda3905dfb94d3f93c07c5f263f41813f (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/linux/swap.h')
-rw-r--r--include/linux/swap.h15
1 files changed, 15 insertions, 0 deletions
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
236extern int page_evictable(struct page *page, struct vm_area_struct *vma); 237extern int page_evictable(struct page *page, struct vm_area_struct *vma);
237extern void scan_mapping_unevictable_pages(struct address_space *); 238extern void scan_mapping_unevictable_pages(struct address_space *);
239
240extern unsigned long scan_unevictable_pages;
241extern int scan_unevictable_handler(struct ctl_table *, int, struct file *,
242 void __user *, size_t *, loff_t *);
243extern int scan_unevictable_register_node(struct node *node);
244extern void scan_unevictable_unregister_node(struct node *node);
238#else 245#else
239static inline int page_evictable(struct page *page, 246static 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
244static inline void scan_mapping_unevictable_pages(struct address_space *mapping) 252static inline void scan_mapping_unevictable_pages(struct address_space *mapping)
245{ 253{
246} 254}
255
256static inline int scan_unevictable_register_node(struct node *node)
257{
258 return 0;
259}
260
261static inline void scan_unevictable_unregister_node(struct node *node) { }
247#endif 262#endif
248 263
249extern int kswapd_run(int nid); 264extern int kswapd_run(int nid);