Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6651402imu; Mon, 3 Dec 2018 00:02:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/VRVHR86u2sVLsh5nHXswKKuBe9my72AC9DuguojriSKnYjzCs4MpeKnAmOYGBQeF/xpRDl X-Received: by 2002:a62:7a8b:: with SMTP id v133mr15231336pfc.159.1543824177913; Mon, 03 Dec 2018 00:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543824177; cv=none; d=google.com; s=arc-20160816; b=duZhgcBt1MwKzGLBUn/w6hxH4eAw2QL892bdsC3H58p5jlcFIxDeDua8w1ozvNxoqU B2xj2TYuvwjIDyfaFLnKwvsx7ThSP1CTzSO9ad6RatjpKlsjACB4Hxaw/G4bOjX58Cp4 8AMohjQsObkgCWsOaL/lGrvcCHtmAfJ7yVU1IknaC0JsriI0M4EYMaDWWsVU76kNGH0H how5yaNQb0OQitxCGsf7OFdOizyTPv3IrhgZgzpk+9NBsPmLMFYIt63Snn70kKg1bwIP QpnTwjditHvrn6Z6lQ75jzGSTS0OXlf/myySZ2fRc3e8gf0eOH1MsZQCwaSDrECDN0Gn RaGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=kpSHdjsIpdnFrfWLr5GbhnM5za7atIDqubrwM25NgRs=; b=YCARldyxSoLLGldVi03ya4JIq9FIH7OPldhR7EBYdzLP7y75XxE/RLzigUqQJy/daN vwm93LOz9Lwoi5vTk1COnDTUFgKQfJKlEPuuQEdFoF6+gvK8PmYEUstbRKxRYOI+HGEs ppSN7zsqZ0Sx2WyrRISW3PRTLc6Fa7o4FpLB9PQON6q2UICN8v+xMi+yyG9KAZpQ+EDD i1UImXmVRyuZoUUuy8q2o1B3VcGfFptqC4QaawfMufk6Bgk+F24zkLdXMTAKpHtgp2P1 Rmh/k1knTRQ5RPRywZ8tjAdhEjWvEx1Fwu0Hr5egUZpDVtTNh9mlMgxNNK2XBZMJISQV KZSw== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si12481073pls.146.2018.12.03.00.02.43; Mon, 03 Dec 2018 00:02:57 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725986AbeLCIBh (ORCPT + 99 others); Mon, 3 Dec 2018 03:01:37 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:35541 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbeLCIBg (ORCPT ); Mon, 3 Dec 2018 03:01:36 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04428;MF=xlpang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0TEitRAJ_1543824080; Received: from localhost(mailfrom:xlpang@linux.alibaba.com fp:SMTPD_---0TEitRAJ_1543824080) by smtp.aliyun-inc.com(127.0.0.1); Mon, 03 Dec 2018 16:01:20 +0800 From: Xunlei Pang To: Michal Hocko , Roman Gushchin , Johannes Weiner Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory Date: Mon, 3 Dec 2018 16:01:18 +0800 Message-Id: <20181203080119.18989-2-xlpang@linux.alibaba.com> X-Mailer: git-send-email 2.14.4.44.g2045bb6 In-Reply-To: <20181203080119.18989-1-xlpang@linux.alibaba.com> References: <20181203080119.18989-1-xlpang@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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)