From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F253C433EF for ; Fri, 26 Nov 2021 16:24:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88E8A6B0075; Fri, 26 Nov 2021 11:24:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 814FD6B0078; Fri, 26 Nov 2021 11:24:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DD2C6B007B; Fri, 26 Nov 2021 11:24:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0041.hostedemail.com [216.40.44.41]) by kanga.kvack.org (Postfix) with ESMTP id 5F9396B0075 for ; Fri, 26 Nov 2021 11:24:31 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2C33384777 for ; Fri, 26 Nov 2021 16:24:21 +0000 (UTC) X-FDA: 78851603922.02.55FB83C Received: from outbound-smtp14.blacknight.com (outbound-smtp14.blacknight.com [46.22.139.231]) by imf14.hostedemail.com (Postfix) with ESMTP id 8BF1C60019A1 for ; Fri, 26 Nov 2021 16:24:19 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp14.blacknight.com (Postfix) with ESMTPS id D16A31C5978 for ; Fri, 26 Nov 2021 16:24:18 +0000 (GMT) Received: (qmail 24859 invoked from network); 26 Nov 2021 16:24:18 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 26 Nov 2021 16:24:18 -0000 Date: Fri, 26 Nov 2021 16:24:16 +0000 From: Mel Gorman To: Alexey Avramov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@suse.com, vbabka@suse.cz, neilb@suse.de, akpm@linux-foundation.org, corbet@lwn.net, riel@surriel.com, hannes@cmpxchg.org, david@fromorbit.com, willy@infradead.org, hdanton@sina.com, penguin-kernel@i-love.sakura.ne.jp, oleksandr@natalenko.name, kernel@xanmod.org, michael@michaellarabel.com, aros@gmx.com, hakavlad@gmail.com Subject: Re: mm: 5.16 regression: reclaim_throttle leads to stall in near-OOM conditions Message-ID: <20211126162416.GK3366@techsingularity.net> References: <20211124011954.7cab9bb4@mail.inbox.lv> <20211124103550.GE3366@techsingularity.net> <20211124195449.33f31e7f@mail.inbox.lv> <20211124115007.GG3366@techsingularity.net> <20211124214443.5c179d34@mail.inbox.lv> <20211124143303.GH3366@techsingularity.net> <20211127010631.4e33a432@mail.inbox.lv> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20211127010631.4e33a432@mail.inbox.lv> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 8BF1C60019A1 X-Stat-Signature: 1wiji8pfmt5qrc431zdpr875kfme8j4i Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf14.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.139.231 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-HE-Tag: 1637943859-678131 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Nov 27, 2021 at 01:06:31AM +0900, Alexey Avramov wrote: > >Please let me know if this version works any better > > It's better, but not the same as 5.15. > > Sometimes stall is short, sometimes is long (3 `tail /dev/zero` test): > It's somewhat expected. If the system is able to make some sort of progress and kswapd is active, it'll throttle until progress is impossible. It'll be somewhat variable how long it can keep making progress be it discarding page cache or writing to swap but it'll only OOM when the system is truly OOM. Might be worth trying the patch below on top. It will delay throttling for longer with the caveat that CPU usage due to reclaim when very low on memory may be excessive. diff --git a/mm/vmscan.c b/mm/vmscan.c index 176ddd28df21..167ea4f324a8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3404,8 +3404,8 @@ static void consider_reclaim_throttle(pg_data_t *pgdat, struct scan_control *sc) if (current_is_kswapd()) return; - /* Throttle if making no progress at high prioities. */ - if (sc->priority < DEF_PRIORITY - 2 && !sc->nr_reclaimed) + /* Throttle if making no progress at high priority. */ + if (sc->priority == 1 && !sc->nr_reclaimed) reclaim_throttle(pgdat, VMSCAN_THROTTLE_NOPROGRESS); }