Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4851192pxb; Thu, 14 Oct 2021 13:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjo1omVNTS4rrJN0HEt+aFBq0oSSZ239xrnqqKIZ5ymh5uc77K4GkMIL2ULEa6nNMNw9/5 X-Received: by 2002:a17:90a:4207:: with SMTP id o7mr8376380pjg.192.1634242662507; Thu, 14 Oct 2021 13:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634242662; cv=none; d=google.com; s=arc-20160816; b=bLzjf5YmZaOKhRvFNXSeImO9e7NqdBB46AfYHYHnr5hS1KINJz7TLO/71eaR1evLBo qnIh+8vo0ALAqgSZDeU+HV1nvoa4LxIjr28OtgXLBKJySqBcqYrDF3DW4epgTstwpcGR l3Z2FBGuSCecA0zhBy3jFu54QdqqiitDrpxT7UbhoPvq/eOiM2j5pArsQ0y7Twl/O7ao 54VeUv2mZIveCDPRYuDMXyiP9biBDvYhT20igqIA5H5NT3NEo/7o9FvOSDi6IqYg6SYk BxE5bc0YagahovSA+SfpVic90IVfE2gOftXnvgKEyrEsE+zX+VNpC2hxLPX+mpo7LFXA KOOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=cSq5ptbvrWE/9u83361E4QAaf4yB/DROBMgoAb6pL8w=; b=a4W4NOAS7vqgFdQGqb9YDkO54hLktJKcXJUkIFwwQB2yJ3BWx2TJ8Nn/Fzm4Zs9RUz 34fwzZp4j9pd26G1QR7cKW4sbIoh1wJjcZ/ly0g+aiQ1v4L1qJOzdQGghXh8DwHtJWWE emFAmLWUFQdqMWtHzf/mpJmgm8ScDocQJGxits2hNhP2c7PNfgtn9S9ESDTa7HBAxkeD zgHEdAwk7G4jJKFHvwC6X3C9yxT25r7pg0wdQjVk/hD7JEuBomRbKYZ4/+4B8lTH/w/m G0DaK6ADnavg7e3feEoOh3SdyCZ5euZlViw8SpP0xC94P5a7vYsQ+0OwENvnSsVAwfBG DpQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=POWMIGPQ; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y129si5026969pfb.64.2021.10.14.13.17.29; Thu, 14 Oct 2021 13:17:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=POWMIGPQ; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbhJNPgt (ORCPT + 99 others); Thu, 14 Oct 2021 11:36:49 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:57002 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhJNPgs (ORCPT ); Thu, 14 Oct 2021 11:36:48 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >