Skip to content
Commit c702418f authored by Johannes Weiner's avatar Johannes Weiner Committed by Linus Torvalds
Browse files

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: default avatarJohannes Weiner <hannes@cmpxchg.org>
Reported-and-tested-by: default avatarThorsten Leemhuis <fedora@leemhuis.info>
Reported-by: default avatarJiri Slaby <jslaby@suse.cz>
Tested-by: default avatarJohn Ellson <john.ellson@comcast.net>
Tested-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
Tested-by: default avatarBruno Wolff III <bruno@wolff.to>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 60177d31
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment