diff options
author | Rik van Riel <riel@redhat.com> | 2008-10-18 23:26:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:50:25 -0400 |
commit | 68a22394c286a2daf06ee8d65d8835f738faefa5 (patch) | |
tree | 1fb91d5bf57a1f6d1cabaac0a6f5d86060ebecb5 /include/linux | |
parent | f04e9ebbe4909f9a41efd55149bc353299f4e83b (diff) |
vmscan: free swap space on swap-in/activation
If vm_swap_full() (swap space more than 50% full), the system will free
swap space at swapin time. With this patch, the system will also free the
swap space in the pageout code, when we decide that the page is not a
candidate for swapout (and just wasting swap space).
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Signed-off-by: MinChan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pagevec.h | 1 | ||||
-rw-r--r-- | include/linux/swap.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index 6b8f11bcc948..fea3a982ee55 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
@@ -25,6 +25,7 @@ void __pagevec_release_nonlru(struct pagevec *pvec); | |||
25 | void __pagevec_free(struct pagevec *pvec); | 25 | void __pagevec_free(struct pagevec *pvec); |
26 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); | 26 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); |
27 | void pagevec_strip(struct pagevec *pvec); | 27 | void pagevec_strip(struct pagevec *pvec); |
28 | void pagevec_swap_free(struct pagevec *pvec); | ||
28 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, | 29 | unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, |
29 | pgoff_t start, unsigned nr_pages); | 30 | pgoff_t start, unsigned nr_pages); |
30 | unsigned pagevec_lookup_tag(struct pagevec *pvec, | 31 | unsigned pagevec_lookup_tag(struct pagevec *pvec, |
diff --git a/include/linux/swap.h b/include/linux/swap.h index fcc169610d09..833be56ad835 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -265,6 +265,7 @@ extern sector_t swapdev_block(int, pgoff_t); | |||
265 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 265 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
266 | extern int can_share_swap_page(struct page *); | 266 | extern int can_share_swap_page(struct page *); |
267 | extern int remove_exclusive_swap_page(struct page *); | 267 | extern int remove_exclusive_swap_page(struct page *); |
268 | extern int remove_exclusive_swap_page_ref(struct page *); | ||
268 | struct backing_dev_info; | 269 | struct backing_dev_info; |
269 | 270 | ||
270 | /* linux/mm/thrash.c */ | 271 | /* linux/mm/thrash.c */ |
@@ -353,6 +354,11 @@ static inline int remove_exclusive_swap_page(struct page *p) | |||
353 | return 0; | 354 | return 0; |
354 | } | 355 | } |
355 | 356 | ||
357 | static inline int remove_exclusive_swap_page_ref(struct page *page) | ||
358 | { | ||
359 | return 0; | ||
360 | } | ||
361 | |||
356 | static inline swp_entry_t get_swap_page(void) | 362 | static inline swp_entry_t get_swap_page(void) |
357 | { | 363 | { |
358 | swp_entry_t entry; | 364 | swp_entry_t entry; |