aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2012-12-04 11:11:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-06 14:29:57 -0500
commitc702418f8a2fa6cc92e84a39880d458faf7af9cc (patch)
tree47dd6cd64f293c6956f7988503da2f3327094b84 /mm/vmscan.c
parent60177d31d215bc2b4c5a7aa6f742800e04fa0a92 (diff)
mm: vmscan: do not keep kswapd looping forever due to individual uncompactable zones
When a zone meets its high watermark and is compactable in case of higher order allocations, it contributes to the percentage of the node's memory that is considered balanced. This requirement, that a node be only partially balanced, came about when kswapd was desparately trying to balance tiny zones when all bigger zones in the node had plenty of free memory. Arguably, the same should apply to compaction: if a significant part of the node is balanced enough to run compaction, do not get hung up on that tiny zone that might never get in shape. When the compaction logic in kswapd is reached, we know that at least 25% of the node's memory is balanced properly for compaction (see zone_balanced and pgdat_balanced). Remove the individual zone checks that restart the kswapd cycle. Otherwise, we may observe more endless looping in kswapd where the compaction code loops back to reclaim because of a single zone and reclaim does nothing because the node is considered balanced overall. See for example https://bugzilla.redhat.com/show_bug.cgi?id=866988 Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reported-and-tested-by: Thorsten Leemhuis <fedora@leemhuis.info> Reported-by: Jiri Slaby <jslaby@suse.cz> Tested-by: John Ellson <john.ellson@comcast.net> Tested-by: Zdenek Kabelac <zkabelac@redhat.com> Tested-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 83f4d0e85601..124bbfe5cc52 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2823,22 +2823,6 @@ out:
2823 if (!populated_zone(zone)) 2823 if (!populated_zone(zone))
2824 continue; 2824 continue;
2825 2825
2826 if (zone->all_unreclaimable &&
2827 sc.priority != DEF_PRIORITY)
2828 continue;
2829
2830 /* Would compaction fail due to lack of free memory? */
2831 if (COMPACTION_BUILD &&
2832 compaction_suitable(zone, order) == COMPACT_SKIPPED)
2833 goto loop_again;
2834
2835 /* Confirm the zone is balanced for order-0 */
2836 if (!zone_watermark_ok(zone, 0,
2837 high_wmark_pages(zone), 0, 0)) {
2838 order = sc.order = 0;
2839 goto loop_again;
2840 }
2841
2842 /* Check if the memory needs to be defragmented. */ 2826 /* Check if the memory needs to be defragmented. */
2843 if (zone_watermark_ok(zone, order, 2827 if (zone_watermark_ok(zone, order,
2844 low_wmark_pages(zone), *classzone_idx, 0)) 2828 low_wmark_pages(zone), *classzone_idx, 0))