aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@techsingularity.net>2015-11-06 19:28:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-06 20:50:42 -0500
commit71baba4b92dc1fa1bc461742c6ab1942ec6034e9 (patch)
tree48c361ba0cc06890703bee1464a9349519118330 /kernel/power/swap.c
parent40113370836e8e79befa585277296ed42781ef31 (diff)
mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM
__GFP_WAIT was used to signal that the caller was in atomic context and could not sleep. Now it is possible to distinguish between true atomic context and callers that are not willing to sleep. The latter should clear __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing __GFP_WAIT behaves differently, there is a risk that people will clear the wrong flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly indicate what it does -- setting it allows all reclaim activity, clearing them prevents it. [akpm@linux-foundation.org: fix build] [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Christoph Lameter <cl@linux.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Vitaly Wool <vitalywool@gmail.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 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index b2066fb5b10f..12cd989dadf6 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -257,7 +257,7 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr,
257 struct bio *bio; 257 struct bio *bio;
258 int error = 0; 258 int error = 0;
259 259
260 bio = bio_alloc(__GFP_WAIT | __GFP_HIGH, 1); 260 bio = bio_alloc(__GFP_RECLAIM | __GFP_HIGH, 1);
261 bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); 261 bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9);
262 bio->bi_bdev = hib_resume_bdev; 262 bio->bi_bdev = hib_resume_bdev;
263 263
@@ -356,7 +356,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
356 return -ENOSPC; 356 return -ENOSPC;
357 357
358 if (hb) { 358 if (hb) {
359 src = (void *)__get_free_page(__GFP_WAIT | __GFP_NOWARN | 359 src = (void *)__get_free_page(__GFP_RECLAIM | __GFP_NOWARN |
360 __GFP_NORETRY); 360 __GFP_NORETRY);
361 if (src) { 361 if (src) {
362 copy_page(src, buf); 362 copy_page(src, buf);
@@ -364,7 +364,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
364 ret = hib_wait_io(hb); /* Free pages */ 364 ret = hib_wait_io(hb); /* Free pages */
365 if (ret) 365 if (ret)
366 return ret; 366 return ret;
367 src = (void *)__get_free_page(__GFP_WAIT | 367 src = (void *)__get_free_page(__GFP_RECLAIM |
368 __GFP_NOWARN | 368 __GFP_NOWARN |
369 __GFP_NORETRY); 369 __GFP_NORETRY);
370 if (src) { 370 if (src) {
@@ -672,7 +672,7 @@ static int save_image_lzo(struct swap_map_handle *handle,
672 nr_threads = num_online_cpus() - 1; 672 nr_threads = num_online_cpus() - 1;
673 nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); 673 nr_threads = clamp_val(nr_threads, 1, LZO_THREADS);
674 674
675 page = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH); 675 page = (void *)__get_free_page(__GFP_RECLAIM | __GFP_HIGH);
676 if (!page) { 676 if (!page) {
677 printk(KERN_ERR "PM: Failed to allocate LZO page\n"); 677 printk(KERN_ERR "PM: Failed to allocate LZO page\n");
678 ret = -ENOMEM; 678 ret = -ENOMEM;
@@ -975,7 +975,7 @@ static int get_swap_reader(struct swap_map_handle *handle,
975 last = tmp; 975 last = tmp;
976 976
977 tmp->map = (struct swap_map_page *) 977 tmp->map = (struct swap_map_page *)
978 __get_free_page(__GFP_WAIT | __GFP_HIGH); 978 __get_free_page(__GFP_RECLAIM | __GFP_HIGH);
979 if (!tmp->map) { 979 if (!tmp->map) {
980 release_swap_reader(handle); 980 release_swap_reader(handle);
981 return -ENOMEM; 981 return -ENOMEM;
@@ -1242,9 +1242,9 @@ static int load_image_lzo(struct swap_map_handle *handle,
1242 1242
1243 for (i = 0; i < read_pages; i++) { 1243 for (i = 0; i < read_pages; i++) {
1244 page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ? 1244 page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ?
1245 __GFP_WAIT | __GFP_HIGH : 1245 __GFP_RECLAIM | __GFP_HIGH :
1246 __GFP_WAIT | __GFP_NOWARN | 1246 __GFP_RECLAIM | __GFP_NOWARN |
1247 __GFP_NORETRY); 1247 __GFP_NORETRY);
1248 1248
1249 if (!page[i]) { 1249 if (!page[i]) {
1250 if (i < LZO_CMP_PAGES) { 1250 if (i < LZO_CMP_PAGES) {