diff options
author | Hugh Dickins <hugh.dickins@tiscali.co.uk> | 2009-12-14 20:58:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:16 -0500 |
commit | aaa468653b4a0d11c603c48d716f765177a5a9e4 (patch) | |
tree | 3cb8c9232dd405001fa38d5519937c5e6c6f32ab /include | |
parent | 570a335b8e22579e2a51a68136d2b1f907a20eec (diff) |
swap_info: note SWAP_MAP_SHMEM
While we're fiddling with the swap_map values, let's assign a particular
value to shmem/tmpfs swap pages: their swap counts are never incremented,
and it helps swapoff's try_to_unuse() a little if it can immediately
distinguish those pages from process pages.
Since we've no use for SWAP_MAP_BAD | COUNT_CONTINUED,
we might as well use that 0xbf value for SWAP_MAP_SHMEM.
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.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.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h index 389e7bd92cca..ac43d87b89b0 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -157,6 +157,7 @@ enum { | |||
157 | #define SWAP_HAS_CACHE 0x40 /* Flag page is cached, in first swap_map */ | 157 | #define SWAP_HAS_CACHE 0x40 /* Flag page is cached, in first swap_map */ |
158 | #define SWAP_CONT_MAX 0x7f /* Max count, in each swap_map continuation */ | 158 | #define SWAP_CONT_MAX 0x7f /* Max count, in each swap_map continuation */ |
159 | #define COUNT_CONTINUED 0x80 /* See swap_map continuation for full count */ | 159 | #define COUNT_CONTINUED 0x80 /* See swap_map continuation for full count */ |
160 | #define SWAP_MAP_SHMEM 0xbf /* Owned by shmem/tmpfs, in first swap_map */ | ||
160 | 161 | ||
161 | /* | 162 | /* |
162 | * The in-memory structure used to track swap areas. | 163 | * The in-memory structure used to track swap areas. |
@@ -316,6 +317,7 @@ extern swp_entry_t get_swap_page(void); | |||
316 | extern swp_entry_t get_swap_page_of_type(int); | 317 | extern swp_entry_t get_swap_page_of_type(int); |
317 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 318 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
318 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); | 319 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); |
320 | extern void swap_shmem_alloc(swp_entry_t); | ||
319 | extern int swap_duplicate(swp_entry_t); | 321 | extern int swap_duplicate(swp_entry_t); |
320 | extern int swapcache_prepare(swp_entry_t); | 322 | extern int swapcache_prepare(swp_entry_t); |
321 | extern void swap_free(swp_entry_t); | 323 | extern void swap_free(swp_entry_t); |
@@ -394,6 +396,10 @@ static inline int add_swap_count_continuation(swp_entry_t swp, gfp_t gfp_mask) | |||
394 | return 0; | 396 | return 0; |
395 | } | 397 | } |
396 | 398 | ||
399 | static inline void swap_shmem_alloc(swp_entry_t swp) | ||
400 | { | ||
401 | } | ||
402 | |||
397 | static inline int swap_duplicate(swp_entry_t swp) | 403 | static inline int swap_duplicate(swp_entry_t swp) |
398 | { | 404 | { |
399 | return 0; | 405 | return 0; |