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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18D61C433FE for ; Thu, 14 Oct 2021 15:34:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 97B5E60F59 for ; Thu, 14 Oct 2021 15:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 97B5E60F59 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1CEB6900003; Thu, 14 Oct 2021 11:34:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17CE8900002; Thu, 14 Oct 2021 11:34:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06D56900003; Thu, 14 Oct 2021 11:34:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id EC696900002 for ; Thu, 14 Oct 2021 11:34:44 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A60E28249980 for ; Thu, 14 Oct 2021 15:34:44 +0000 (UTC) X-FDA: 78695440488.23.B316F1F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf12.hostedemail.com (Postfix) with ESMTP id 0B44210000AF for ; Thu, 14 Oct 2021 15:34:43 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A8ABC1FD3C; Thu, 14 Oct 2021 15:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634225682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cSq5ptbvrWE/9u83361E4QAaf4yB/DROBMgoAb6pL8w=; b=POWMIGPQ4r7BOmmAbumhlw45VMBqKqkvgGUD6siLJfp+5yYk+xAgZPtTuDivBnusGMrLRL +6rdvnXMtr9alOFVTerJ4+paqp9rVrj9jhpjCdHL9bhE8lRPgwF2KmNEqGtUaBcQDZnVeS 9C7ZS5gtSrAaH4avOpBoyACbbhAVmXs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634225682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cSq5ptbvrWE/9u83361E4QAaf4yB/DROBMgoAb6pL8w=; b=BJwII89kUlyU/1vQJNfVlrdx0HDpTDhd2fjXcjOvj6Sfb5zD84iug0bBXWEoieO2Agfvd7 3I4mBzKmGkcGweBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 70E1E13D9F; Thu, 14 Oct 2021 15:34:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CVXCGhJOaGF/HQAAMHmgww (envelope-from ); Thu, 14 Oct 2021 15:34:42 +0000 Message-ID: Date: Thu, 14 Oct 2021 17:34:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 4/8] mm/writeback: Throttle based on page writeback instead of congestion Content-Language: en-US To: Mel Gorman , Linux-MM Cc: NeilBrown , Theodore Ts'o , Andreas Dilger , "Darrick J . Wong" , Matthew Wilcox , Michal Hocko , Dave Chinner , Rik van Riel , Johannes Weiner , Jonathan Corbet , Linux-fsdevel , LKML References: <20211008135332.19567-1-mgorman@techsingularity.net> <20211008135332.19567-5-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20211008135332.19567-5-mgorman@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: 7z65tutfkocqsetnh6nfuaqto8ne68g4 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=POWMIGPQ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=BJwII89k; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0B44210000AF X-HE-Tag: 1634225683-713076 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 10/8/21 15:53, Mel Gorman wrote: > do_writepages throttles on congestion if the writepages() fails due to a > lack of memory but congestion_wait() is partially broken as the congestion > state is not updated for all BDIs. > > This patch stalls waiting for a number of pages to complete writeback > that located on the local node. The main weakness is that there is no > correlation between the location of the inode's pages and locality but > that is still better than congestion_wait. > > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka > --- > mm/page-writeback.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 4812a17b288c..f34f54fcd5b4 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -2366,8 +2366,15 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc) > ret = generic_writepages(mapping, wbc); > if ((ret != -ENOMEM) || (wbc->sync_mode != WB_SYNC_ALL)) > break; > - cond_resched(); > - congestion_wait(BLK_RW_ASYNC, HZ/50); > + > + /* > + * Lacking an allocation context or the locality or writeback > + * state of any of the inode's pages, throttle based on > + * writeback activity on the local node. It's as good a > + * guess as any. > + */ > + reclaim_throttle(NODE_DATA(numa_node_id()), > + VMSCAN_THROTTLE_WRITEBACK, HZ/50); > } > /* > * Usually few pages are written by now from those we've just submitted >