Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: page_alloc: revert NUMA aspect of fair allocation policy

Commit 81c0a2bb515f ("mm: page_alloc: fair zone allocator policy") meant
to bring aging fairness among zones in system, but it was overzealous
and badly regressed basic workloads on NUMA systems.

Due to the way kswapd and page allocator interacts, we still want to
make sure that all zones in any given node are used equally for all
allocations to maximize memory utilization and prevent thrashing on the
highest zone in the node.

While the same principle applies to NUMA nodes - memory utilization is
obviously improved by spreading allocations throughout all nodes -
remote references can be costly and so many workloads prefer locality
over memory utilization. The original change assumed that
zone_reclaim_mode would be a good enough predictor for that, but it
turned out to be as indicative as a coin flip.

Revert the NUMA aspect of the fairness until we can find a proper way to
make it configurable and agree on a sane default.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: <stable@kernel.org> # 3.12
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Johannes Weiner and committed by
Linus Torvalds
fff4068c 8798cee2

+9 -10
+9 -10
mm/page_alloc.c
··· 1816 1816 1817 1817 static bool zone_local(struct zone *local_zone, struct zone *zone) 1818 1818 { 1819 - return node_distance(local_zone->node, zone->node) == LOCAL_DISTANCE; 1819 + return local_zone->node == zone->node; 1820 1820 } 1821 1821 1822 1822 static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone) ··· 1913 1913 * page was allocated in should have no effect on the 1914 1914 * time the page has in memory before being reclaimed. 1915 1915 * 1916 - * When zone_reclaim_mode is enabled, try to stay in 1917 - * local zones in the fastpath. If that fails, the 1918 - * slowpath is entered, which will do another pass 1919 - * starting with the local zones, but ultimately fall 1920 - * back to remote zones that do not partake in the 1921 - * fairness round-robin cycle of this zonelist. 1916 + * Try to stay in local zones in the fastpath. If 1917 + * that fails, the slowpath is entered, which will do 1918 + * another pass starting with the local zones, but 1919 + * ultimately fall back to remote zones that do not 1920 + * partake in the fairness round-robin cycle of this 1921 + * zonelist. 1922 1922 */ 1923 1923 if (alloc_flags & ALLOC_WMARK_LOW) { 1924 1924 if (zone_page_state(zone, NR_ALLOC_BATCH) <= 0) 1925 1925 continue; 1926 - if (zone_reclaim_mode && 1927 - !zone_local(preferred_zone, zone)) 1926 + if (!zone_local(preferred_zone, zone)) 1928 1927 continue; 1929 1928 } 1930 1929 /* ··· 2389 2390 * thrash fairness information for zones that are not 2390 2391 * actually part of this zonelist's round-robin cycle. 2391 2392 */ 2392 - if (zone_reclaim_mode && !zone_local(preferred_zone, zone)) 2393 + if (!zone_local(preferred_zone, zone)) 2393 2394 continue; 2394 2395 mod_zone_page_state(zone, NR_ALLOC_BATCH, 2395 2396 high_wmark_pages(zone) -