summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrey Ryabinin <aryabinin@virtuozzo.com>2019-04-26 01:24:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-26 12:18:05 -0400
commit8118b82eb756e271929697e8ada5f637dc443af1 (patch)
treebbbf95c64a11095a12f9e2148cdbd8037d9a141b /mm
parent8139ad043d632c0e9e12d760068a7a8e91659aa1 (diff)
mm/page_alloc.c: fix never set ALLOC_NOFRAGMENT flag
Commit 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") removed setting of the ALLOC_NOFRAGMENT flag. Bring it back. The runtime effect is that ALLOC_NOFRAGMENT behaviour is restored so that allocations are spread across local zones to avoid fragmentation due to mixing pageblocks as long as possible. Link: http://lkml.kernel.org/r/20190423120806.3503-2-aryabinin@virtuozzo.com Fixes: 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> 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/page_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9992ca7f29f1..c02cff1ed56e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3436,7 +3436,7 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
3436 return alloc_flags; 3436 return alloc_flags;
3437 3437
3438 if (zone_idx(zone) != ZONE_NORMAL) 3438 if (zone_idx(zone) != ZONE_NORMAL)
3439 goto out; 3439 return alloc_flags;
3440 3440
3441 /* 3441 /*
3442 * If ZONE_DMA32 exists, assume it is the one after ZONE_NORMAL and 3442 * If ZONE_DMA32 exists, assume it is the one after ZONE_NORMAL and
@@ -3445,9 +3445,9 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
3445 */ 3445 */
3446 BUILD_BUG_ON(ZONE_NORMAL - ZONE_DMA32 != 1); 3446 BUILD_BUG_ON(ZONE_NORMAL - ZONE_DMA32 != 1);
3447 if (nr_online_nodes > 1 && !populated_zone(--zone)) 3447 if (nr_online_nodes > 1 && !populated_zone(--zone))
3448 goto out; 3448 return alloc_flags;
3449 3449
3450out: 3450 alloc_flags |= ALLOC_NOFRAGMENT;
3451#endif /* CONFIG_ZONE_DMA32 */ 3451#endif /* CONFIG_ZONE_DMA32 */
3452 return alloc_flags; 3452 return alloc_flags;
3453} 3453}