aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2009-01-06 17:39:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:04 -0500
commitb962716b459505a8d83aea313fea0abe76749f42 (patch)
treeb401e882f2ee8ff5a11209057496e603c211e8fe /include
parent60371d971a3d01afd102f0bbf2681f32ecc31d78 (diff)
mm: optimize get_scan_ratio for no swap
Rik suggests a simplified get_scan_ratio() for !CONFIG_SWAP. Yes, the gcc optimizer gives us that, when nr_swap_pages is #defined as 0L. Move usual declaration to swapfile.c: it never belonged in page_alloc.c. Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Acked-by: Rik van Riel <riel@redhat.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Robin Holt <holt@sgi.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/swap.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c0d23ac710d5..3a31cc25bd2c 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -163,7 +163,6 @@ struct swap_list_t {
163/* linux/mm/page_alloc.c */ 163/* linux/mm/page_alloc.c */
164extern unsigned long totalram_pages; 164extern unsigned long totalram_pages;
165extern unsigned long totalreserve_pages; 165extern unsigned long totalreserve_pages;
166extern long nr_swap_pages;
167extern unsigned int nr_free_buffer_pages(void); 166extern unsigned int nr_free_buffer_pages(void);
168extern unsigned int nr_free_pagecache_pages(void); 167extern unsigned int nr_free_pagecache_pages(void);
169 168
@@ -291,6 +290,7 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t,
291 struct vm_area_struct *vma, unsigned long addr); 290 struct vm_area_struct *vma, unsigned long addr);
292 291
293/* linux/mm/swapfile.c */ 292/* linux/mm/swapfile.c */
293extern long nr_swap_pages;
294extern long total_swap_pages; 294extern long total_swap_pages;
295extern void si_swapinfo(struct sysinfo *); 295extern void si_swapinfo(struct sysinfo *);
296extern swp_entry_t get_swap_page(void); 296extern swp_entry_t get_swap_page(void);
@@ -331,7 +331,8 @@ static inline void disable_swap_token(void)
331 331
332#else /* CONFIG_SWAP */ 332#else /* CONFIG_SWAP */
333 333
334#define total_swap_pages 0 334#define nr_swap_pages 0L
335#define total_swap_pages 0L
335#define total_swapcache_pages 0UL 336#define total_swapcache_pages 0UL
336 337
337#define si_swapinfo(val) \ 338#define si_swapinfo(val) \