Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3df2190b authored by Andrey Ryabinin's avatar Andrey Ryabinin Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: I9bffad5e4d77f592a77fd8031d97df504017e87b
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: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Git-commit: 8118b82eb756e271929697e8ada5f637dc443af1
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git


Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent dd0013f2
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -3500,7 +3500,7 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
		return alloc_flags;
		return alloc_flags;


	if (zone_idx(zone) != ZONE_NORMAL)
	if (zone_idx(zone) != ZONE_NORMAL)
		goto out;
		return alloc_flags;


	/*
	/*
	 * If ZONE_DMA32 exists, assume it is the one after ZONE_NORMAL and
	 * If ZONE_DMA32 exists, assume it is the one after ZONE_NORMAL and
@@ -3509,9 +3509,9 @@ alloc_flags_nofragment(struct zone *zone, gfp_t gfp_mask)
	 */
	 */
	BUILD_BUG_ON(ZONE_NORMAL - ZONE_DMA32 != 1);
	BUILD_BUG_ON(ZONE_NORMAL - ZONE_DMA32 != 1);
	if (nr_online_nodes > 1 && !populated_zone(--zone))
	if (nr_online_nodes > 1 && !populated_zone(--zone))
		goto out;
		return alloc_flags;


out:
	alloc_flags |= ALLOC_NOFRAGMENT;
#endif /* CONFIG_ZONE_DMA32 */
#endif /* CONFIG_ZONE_DMA32 */
	return alloc_flags;
	return alloc_flags;
}
}