diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f6005b7c3446..02c1a60d7937 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3805,16 +3805,18 @@ retry: | |||
3805 | return page; | 3805 | return page; |
3806 | } | 3806 | } |
3807 | 3807 | ||
3808 | static void wake_all_kswapds(unsigned int order, const struct alloc_context *ac) | 3808 | static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask, |
3809 | const struct alloc_context *ac) | ||
3809 | { | 3810 | { |
3810 | struct zoneref *z; | 3811 | struct zoneref *z; |
3811 | struct zone *zone; | 3812 | struct zone *zone; |
3812 | pg_data_t *last_pgdat = NULL; | 3813 | pg_data_t *last_pgdat = NULL; |
3814 | enum zone_type high_zoneidx = ac->high_zoneidx; | ||
3813 | 3815 | ||
3814 | for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, | 3816 | for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, high_zoneidx, |
3815 | ac->high_zoneidx, ac->nodemask) { | 3817 | ac->nodemask) { |
3816 | if (last_pgdat != zone->zone_pgdat) | 3818 | if (last_pgdat != zone->zone_pgdat) |
3817 | wakeup_kswapd(zone, order, ac->high_zoneidx); | 3819 | wakeup_kswapd(zone, gfp_mask, order, high_zoneidx); |
3818 | last_pgdat = zone->zone_pgdat; | 3820 | last_pgdat = zone->zone_pgdat; |
3819 | } | 3821 | } |
3820 | } | 3822 | } |
@@ -4093,7 +4095,7 @@ retry_cpuset: | |||
4093 | goto nopage; | 4095 | goto nopage; |
4094 | 4096 | ||
4095 | if (gfp_mask & __GFP_KSWAPD_RECLAIM) | 4097 | if (gfp_mask & __GFP_KSWAPD_RECLAIM) |
4096 | wake_all_kswapds(order, ac); | 4098 | wake_all_kswapds(order, gfp_mask, ac); |
4097 | 4099 | ||
4098 | /* | 4100 | /* |
4099 | * The adjusted alloc_flags might result in immediate success, so try | 4101 | * The adjusted alloc_flags might result in immediate success, so try |
@@ -4151,7 +4153,7 @@ retry_cpuset: | |||
4151 | retry: | 4153 | retry: |
4152 | /* Ensure kswapd doesn't accidentally go to sleep as long as we loop */ | 4154 | /* Ensure kswapd doesn't accidentally go to sleep as long as we loop */ |
4153 | if (gfp_mask & __GFP_KSWAPD_RECLAIM) | 4155 | if (gfp_mask & __GFP_KSWAPD_RECLAIM) |
4154 | wake_all_kswapds(order, ac); | 4156 | wake_all_kswapds(order, gfp_mask, ac); |
4155 | 4157 | ||
4156 | reserve_flags = __gfp_pfmemalloc_flags(gfp_mask); | 4158 | reserve_flags = __gfp_pfmemalloc_flags(gfp_mask); |
4157 | if (reserve_flags) | 4159 | if (reserve_flags) |