diff options
author | Hugh Dickins <hugh@veritas.com> | 2009-01-06 17:39:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:04 -0500 |
commit | b962716b459505a8d83aea313fea0abe76749f42 (patch) | |
tree | b401e882f2ee8ff5a11209057496e603c211e8fe /mm/swapfile.c | |
parent | 60371d971a3d01afd102f0bbf2681f32ecc31d78 (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 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 9ce7f81c8abc..725e56c362de 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | static DEFINE_SPINLOCK(swap_lock); | 36 | static DEFINE_SPINLOCK(swap_lock); |
37 | static unsigned int nr_swapfiles; | 37 | static unsigned int nr_swapfiles; |
38 | long nr_swap_pages; | ||
38 | long total_swap_pages; | 39 | long total_swap_pages; |
39 | static int swap_overflow; | 40 | static int swap_overflow; |
40 | static int least_priority; | 41 | static int least_priority; |