Ack: [Xenial][SRU][PATCH] UBUNTU: SAUCE(no-up): If zone is so small that watermarks are the same, stop zone balance.
Leann Ogasawara
leann.ogasawara at canonical.com
Wed Oct 12 01:26:19 UTC 2016
On 10/11/2016 06:20 PM, Leann Ogasawara wrote:
> On 10/11/2016 06:13 PM, Gavin Guo wrote:
>> BugLink: http://bugs.launchpad.net/bugs/1518457
>>
>> On an AWS t2.micro instance (Xeon E5-2670, 991MiB of memory).
>> Occasionally (about once a day), kswapd0 falls into a busy loop and
>> spins on 100% CPU usage indefinitely. Reject to do the zone balance
>> when the memory is too small.
>>
>> Signed-off-by: Dan Streetman <dan.streetman at canonical.com>
>> Signed-off-by: Gavin Guo <gavin.guo at canonical.com>
>
> Acked-by: Leann Ogasawara <leann.ogasawara at canonical.com>
Jay (on CC) has also tested this so add his:
Tested-by: Jay Vosburgh <jay.vosburgh at canonical.com>
>> ---
>> mm/vmscan.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index 0c114e2b01d3..21755dca16c2 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -2959,6 +2959,13 @@ static void age_active_anon(struct zone *zone, struct scan_control *sc)
>> static bool zone_balanced(struct zone *zone, int order,
>> unsigned long balance_gap, int classzone_idx)
>> {
>> + /*
>> + * if zone is so small that watermarks are the same, don't bother trying
>> + * to balance; kswapd would just spin continuously trying to balance it.
>> + */
>> + if (low_wmark_pages(zone) == high_wmark_pages(zone))
>> + return true;
>> +
>> if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone) +
>> balance_gap, classzone_idx))
>> return false;
>>
More information about the kernel-team
mailing list