diff options
author | Weijie Yang <weijie.yang@samsung.com> | 2014-10-09 18:28:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:57 -0400 |
commit | 7ade3c997208566c5bf50ece8fc319a8caf0d41a (patch) | |
tree | 9932f6503a63a7283c03c281e921502f3ba0b589 /mm/page_alloc.c | |
parent | 81d1b09c6be66afac7d41ee52279d9bccbce56d8 (diff) |
mm: page_alloc: avoid wakeup kswapd on the unintended node
When entering the page_alloc slowpath, we wakeup kswapd on every pgdat
according to the zonelist and high_zoneidx. However, this doesn't take
nodemask into account, and could prematurely wakeup kswapd on some
unintended nodes.
This patch uses for_each_zone_zonelist_nodemask() instead of
for_each_zone_zonelist() in wake_all_kswapds() to avoid the above
situation.
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3a950144f80b..ae2f8474273c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2471,12 +2471,14 @@ __alloc_pages_high_priority(gfp_t gfp_mask, unsigned int order, | |||
2471 | static void wake_all_kswapds(unsigned int order, | 2471 | static void wake_all_kswapds(unsigned int order, |
2472 | struct zonelist *zonelist, | 2472 | struct zonelist *zonelist, |
2473 | enum zone_type high_zoneidx, | 2473 | enum zone_type high_zoneidx, |
2474 | struct zone *preferred_zone) | 2474 | struct zone *preferred_zone, |
2475 | nodemask_t *nodemask) | ||
2475 | { | 2476 | { |
2476 | struct zoneref *z; | 2477 | struct zoneref *z; |
2477 | struct zone *zone; | 2478 | struct zone *zone; |
2478 | 2479 | ||
2479 | for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) | 2480 | for_each_zone_zonelist_nodemask(zone, z, zonelist, |
2481 | high_zoneidx, nodemask) | ||
2480 | wakeup_kswapd(zone, order, zone_idx(preferred_zone)); | 2482 | wakeup_kswapd(zone, order, zone_idx(preferred_zone)); |
2481 | } | 2483 | } |
2482 | 2484 | ||
@@ -2574,7 +2576,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, | |||
2574 | 2576 | ||
2575 | restart: | 2577 | restart: |
2576 | if (!(gfp_mask & __GFP_NO_KSWAPD)) | 2578 | if (!(gfp_mask & __GFP_NO_KSWAPD)) |
2577 | wake_all_kswapds(order, zonelist, high_zoneidx, preferred_zone); | 2579 | wake_all_kswapds(order, zonelist, high_zoneidx, |
2580 | preferred_zone, nodemask); | ||
2578 | 2581 | ||
2579 | /* | 2582 | /* |
2580 | * OK, we're below the kswapd watermark and have kicked background | 2583 | * OK, we're below the kswapd watermark and have kicked background |