Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6849782imu; Mon, 3 Dec 2018 03:59:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uy4CMK0Mmud+3sN9x3RKJPphkpiAMtQmJGM24M2wwzFNeEzlbKxgFTT7f7WFzOa0X/J4tI X-Received: by 2002:a62:b9a:: with SMTP id 26mr15797083pfl.196.1543838366640; Mon, 03 Dec 2018 03:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543838366; cv=none; d=google.com; s=arc-20160816; b=h+07Bon6kNHJozIzaHYyQzZwXSTglTDziEJ9CnybB0zhGOh8da3p5M4dV3TBRoozBF MzrWDkhvfSNq+pbyrsgd3C/5D6I1VUd2TJ19T/StVKIa39+cpoB+ViHP6RNFrtLk4JWu aTANjfgsn6eAjAaBStAkQ9v15n2jRItm4CE1ZxCdg9Lvv38zamDu1kqJDk/2KAik85Sl Jsdy67WPLTtIcyykI3KM1bAHEhZ0GUtpxQlUu4ul5CtSadmSYxAm2/T4UWhDCa8abz3/ LHN+Tn8NbX0crWpgeTyRga7rpe47Y3bUAzmFO15NKr9eACAjxtGW4YgfJsNhR/qz2qfH 12XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BRpkCqAKI+W+ghZTyMOwA7n6gt6kZFLuVALUB79n/a4=; b=m99sKNQSVzdInVDj4LL4+lCbekLu3zK8nA19edlBvbHbmS7iRJJWxTB+h3T7V/PaV9 LmExRgsaqSdr54DxbCILhwSYe3l3icBf3MKhFhZrTPkAQhhQ2F6ySHM1IKcgxYBOR2Fu 6IjhQMjLX+9haJUBGbXlOY0B9DWo01yTJWjQbURLPh6B/RFj9502Xrs41PcGecMGq/gJ IP32WuS6vuH/6BJbgsqTYf19+lvMkRXpriRPWosZeGN3Q6dlJsuSVZFOGXL6BcMh1E1t VxapgnvkHMBXNVsVo0VxZvkxwKch/oXNaO0lEAMcIKu6U+qwrW9Z7Ia625Gwa2/2MaZk 9t3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si13700368plq.210.2018.12.03.03.59.11; Mon, 03 Dec 2018 03:59:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726439AbeLCL5d (ORCPT + 99 others); Mon, 3 Dec 2018 06:57:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:60108 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725975AbeLCL5d (ORCPT ); Mon, 3 Dec 2018 06:57:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9D867AC66; Mon, 3 Dec 2018 11:56:46 +0000 (UTC) Date: Mon, 3 Dec 2018 12:56:46 +0100 From: Michal Hocko To: Xunlei Pang Cc: Roman Gushchin , Johannes Weiner , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory Message-ID: <20181203115646.GP31738@dhcp22.suse.cz> References: <20181203080119.18989-1-xlpang@linux.alibaba.com> <20181203080119.18989-2-xlpang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203080119.18989-2-xlpang@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 03-12-18 16:01:18, Xunlei Pang wrote: > There may be cgroup memory overcommitment, it will become > even common in the future. > > Let's enable kswapd to reclaim low-protected memory in case > of memory pressure, to mitigate the global direct reclaim > pressures which could cause jitters to the response time of > lantency-sensitive groups. Please be more descriptive about the problem you are trying to handle here. I haven't actually read the patch but let me emphasise that the low limit protection is important isolation tool. And allowing kswapd to reclaim protected memcgs is going to break the semantic as it has been introduced and designed. > > Signed-off-by: Xunlei Pang > --- > mm/vmscan.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 62ac0c488624..3d412eb91f73 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -3531,6 +3531,7 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > > count_vm_event(PAGEOUTRUN); > > +retry: > do { > unsigned long nr_reclaimed = sc.nr_reclaimed; > bool raise_priority = true; > @@ -3622,6 +3623,13 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > sc.priority--; > } while (sc.priority >= 1); > > + if (!sc.nr_reclaimed && sc.memcg_low_skipped) { > + sc.priority = DEF_PRIORITY; > + sc.memcg_low_reclaim = 1; > + sc.memcg_low_skipped = 0; > + goto retry; > + } > + > if (!sc.nr_reclaimed) > pgdat->kswapd_failures++; > > -- > 2.13.5 (Apple Git-94) > -- Michal Hocko SUSE Labs