diff options
author | Hugh Dickins <hugh@veritas.com> | 2009-01-06 17:39:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:04 -0500 |
commit | ac47b003d03c2a4f28aef1d505b66d24ad191c4f (patch) | |
tree | 12c31491b756f4dc7a55a9e11b69b193743ff647 /mm | |
parent | 63d6c5ad7fc27455ce5cb4706884671fb7e0df08 (diff) |
mm: remove gfp_mask from add_to_swap
Remove gfp_mask argument from add_to_swap(): it's misleading because its
only caller, shrink_page_list(), is not atomic at that point; and in due
course (implementing discard) we'll sometimes want to allocate some memory
with GFP_NOIO (as is used in swap_writepage) when allocating swap.
No change to the gfp_mask passed down to add_to_swap_cache(): still use
__GFP_HIGH without __GFP_WAIT (with nomemalloc and nowarn as before):
though it's not obvious if that's the best combination to ask for here.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: 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')
-rw-r--r-- | mm/swap_state.c | 4 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index bcb472769299..81c825f67a7f 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -128,7 +128,7 @@ void __delete_from_swap_cache(struct page *page) | |||
128 | * Allocate swap space for the page and add the page to the | 128 | * Allocate swap space for the page and add the page to the |
129 | * swap cache. Caller needs to hold the page lock. | 129 | * swap cache. Caller needs to hold the page lock. |
130 | */ | 130 | */ |
131 | int add_to_swap(struct page * page, gfp_t gfp_mask) | 131 | int add_to_swap(struct page *page) |
132 | { | 132 | { |
133 | swp_entry_t entry; | 133 | swp_entry_t entry; |
134 | int err; | 134 | int err; |
@@ -153,7 +153,7 @@ int add_to_swap(struct page * page, gfp_t gfp_mask) | |||
153 | * Add it to the swap cache and mark it dirty | 153 | * Add it to the swap cache and mark it dirty |
154 | */ | 154 | */ |
155 | err = add_to_swap_cache(page, entry, | 155 | err = add_to_swap_cache(page, entry, |
156 | gfp_mask|__GFP_NOMEMALLOC|__GFP_NOWARN); | 156 | __GFP_HIGH|__GFP_NOMEMALLOC|__GFP_NOWARN); |
157 | 157 | ||
158 | switch (err) { | 158 | switch (err) { |
159 | case 0: /* Success */ | 159 | case 0: /* Success */ |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 74f875733e2b..cc7401571cba 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -625,7 +625,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, | |||
625 | if (PageAnon(page) && !PageSwapCache(page)) { | 625 | if (PageAnon(page) && !PageSwapCache(page)) { |
626 | if (!(sc->gfp_mask & __GFP_IO)) | 626 | if (!(sc->gfp_mask & __GFP_IO)) |
627 | goto keep_locked; | 627 | goto keep_locked; |
628 | if (!add_to_swap(page, GFP_ATOMIC)) | 628 | if (!add_to_swap(page)) |
629 | goto activate_locked; | 629 | goto activate_locked; |
630 | may_enter_fs = 1; | 630 | may_enter_fs = 1; |
631 | } | 631 | } |