Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1565353pxm; Thu, 3 Mar 2022 22:02:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzXdV+UuKSUEHIomWLQKwAruuKAvmJJOq8M//s5ylXCdOF9CJxKaBy0i3Dae9LRD2hhzIb X-Received: by 2002:a17:902:e5c3:b0:14f:a4ff:34b8 with SMTP id u3-20020a170902e5c300b0014fa4ff34b8mr39062169plf.24.1646373766070; Thu, 03 Mar 2022 22:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646373766; cv=none; d=google.com; s=arc-20160816; b=opfTuMOEudfZkHTs+Dra6kYlu/SFGQG6w6RQLn/levs1sBNYCqEf+jUOqflrzt2i9I /BcZiXGJsJD2WUZJ5LAs7OwIR8t0KubcvKmY6HuLeNCdP35clE5HGPHv5sd5sAaRXnsW r2dqcv8C3oKrj8wMSyfJCc67JnCg6XX0KtnXIySoRGscNzedVs1Q+UyG1gVSg+BCkYVF Riq+QjUo35EQGSSjKwE3s9NVNSSE5CLhCw+A9DLLwq+dAPm5V77PCgHwxz3R/CVm9i2V f1J2QmRD1aVxzglFuXfUigBAE0my0N088Dp0wa1HyWRWQRDb8BWno1HU3IJX0kUOGiNN Fkgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=bRC9lR391e01DA8hmQQ11oCmTpgoNtai0DhkKiv/gqA=; b=XdxQeu245gWxcOKNtLaZ/OuTjalZ/H68fBXqtnna43TRBB0oEEEx/ok1YpUBZL1XPN Xrj3l0gYDpfr3f6KoVMygp/9+qU6WRksAGOgIWzx8oZZz8ZQk/1v1BmHQqAUrsS+Jisg jDcUSv5Mh32+dvs8+dasEEKDISmQnuItqPmCfjOmKXAAdfBIQ3PbuPQ5RBj5AQXgPDPo IZuxoMng6yVgHckzalwwmai/2mOIATxc5b0nmpNBp5M6Md4BEjd8EjWY4lveKl6z81SM SOYytNGPOlRW0idBfYN9wYyqexkhYC/JWh/yXE1OjYDg9Zw9SzTOMMnbIHki+p6YL5/Y AXPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=DPBLhpCy; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OC3LPp6w; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r75-20020a632b4e000000b0037c4e702181si4023453pgr.494.2022.03.03.22.02.16; Thu, 03 Mar 2022 22:02:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=DPBLhpCy; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=OC3LPp6w; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235039AbiCDCs0 (ORCPT + 99 others); Thu, 3 Mar 2022 21:48:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbiCDCsZ (ORCPT ); Thu, 3 Mar 2022 21:48:25 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E0671BE8D; Thu, 3 Mar 2022 18:47:38 -0800 (PST) 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-out1.suse.de (Postfix) with ESMTPS id B8EE1218D9; Fri, 4 Mar 2022 02:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646362056; 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=bRC9lR391e01DA8hmQQ11oCmTpgoNtai0DhkKiv/gqA=; b=DPBLhpCy8tSefU0o/0cGFUNHFB2ENiUdz7DL+/QuL66B+hanK6/YVNBgksSwMuDLV2K7do gLidl4GftwWDduPicJm1Lt/WdYmoepv57PKKCdtFCC0ehwriXODLDFTWOGNFVdmoGAplJO DhmYXWeTCsa6asBh2ztOs4cXy4qTCUw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646362056; 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=bRC9lR391e01DA8hmQQ11oCmTpgoNtai0DhkKiv/gqA=; b=OC3LPp6wdT68pzKK+cC/1gJqegadfEfURfONkeOYiYNj+tndz1PDCoyP7hDil8izMoBJdD 3yON2S4St8a2wPDw== 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 AA36313AF7; Fri, 4 Mar 2022 02:47:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dPl5GcF9IWJxAgAAMHmgww (envelope-from ); Fri, 04 Mar 2022 02:47:29 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "Andrew Morton" , "Jan Kara" , "Wu Fengguang" , "Jaegeuk Kim" , "Chao Yu" , "Ilya Dryomov" , "Miklos Szeredi" , "Trond Myklebust" , "Anna Schumaker" , "Ryusuke Konishi" , "Darrick J. Wong" , "Philipp Reisner" , "Lars Ellenberg" , "Paolo Valente" , "Jens Axboe" , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-nilfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, ceph-devel@vger.kernel.org, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/11] ceph: remove reliance on bdi congestion In-reply-to: References: <164549971112.9187.16871723439770288255.stgit@noble.brown>, <164549983739.9187.14895675781408171186.stgit@noble.brown>, , <164568131640.25116.884631856219777713@noble.neil.brown.name>, Date: Fri, 04 Mar 2022 13:47:26 +1100 Message-id: <164636204663.29369.1845040729675190216@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, 24 Feb 2022, Jeff Layton wrote: > On Thu, 2022-02-24 at 16:41 +1100, NeilBrown wrote: > > On Thu, 24 Feb 2022, Jeff Layton wrote: > > > On Tue, 2022-02-22 at 14:17 +1100, NeilBrown wrote: > > > > The bdi congestion tracking in not widely used and will be removed. > > > >=20 > > > > CEPHfs is one of a small number of filesystems that uses it, setting > > > > just the async (write) congestion flags at what it determines are > > > > appropriate times. > > > >=20 > > > > The only remaining effect of the async flag is to cause (some) > > > > WB_SYNC_NONE writes to be skipped. > > > >=20 > > > > So instead of setting the flag, set an internal flag and change: > > > > - .writepages to do nothing if WB_SYNC_NONE and the flag is set > > > > - .writepage to return AOP_WRITEPAGE_ACTIVATE if WB_SYNC_NONE > > > > and the flag is set. > > > >=20 > > > > The writepages change causes a behavioural change in that pageout() c= an > > > > now return PAGE_ACTIVATE instead of PAGE_KEEP, so SetPageActive() will > > > > be called on the page which (I think) wil further delay the next atte= mpt > > > > at writeout. This might be a good thing. > > > >=20 > > > > Signed-off-by: NeilBrown > > >=20 > > > Maybe. I have to wonder whether all of this is really useful. > > >=20 > > > When things are congested we'll avoid trying to issue new writeback > > > requests. Note that we don't prevent new pages from being dirtied here - > > > - only their being written back. > > >=20 > > > This also doesn't do anything in the DIO or sync_write cases, so if we > > > lose caps or are doing DIO, we'll just keep churning out "unlimited" > > > writes in those cases anyway. > >=20 > > I think the point of congestion tracking is to differentiate between > > sync and async IO. Or maybe "required" and "optional". > > Eventually the "optional" IO will become required, but if we can delay > > it until a time when there is less "required" io, then maybe we can > > improve perceived latency. > >=20 > > "optional" IO here is write-back and read-ahead. If the load of > > "required" IO is bursty, and if we can shuffle that optional stuff into > > the quiet periods, we might win. > >=20 >=20 > In that case, maybe we should be counting in-flight reads too and deny > readahead when the count crosses some threshold? It seems a bit silly to > only look at writes when it comes to "congestion". I agree that seems a bit silly. >=20 > > Whether this is a real need is an important question that I don't have an > > answer for. And whether it is better to leave delayed requests in the > > page cache, or in the low-level queue with sync requests able to > > over-take them - I don't know. If you have multiple low-level queue as > > you say you can with ceph, then lower might be better. > >=20 > > The block layer has REQ_RAHEAD .. maybe those request get should get a > > lower priority ... though I don't think they do. > > NFS has a 3 level priority queue, with write-back going at a lower > > priority ... I think... for NFSv3 at least. > >=20 > > Sometimes I suspect that as all our transports have become faster, we > > have been able to ignore the extra latency caused by poor scheduling of > > optional requests. But at other times when my recently upgraded desktop > > is struggling to view a web page while compiling a kernel ... I wonder > > if maybe we don't have the balance right any more. > >=20 > > So maybe you are right - maybe we can rip all this stuff out. > >=20 >=20 > I lean more toward just removing it. The existing implementation seems a > bit half-baked with the gaps in what's being counted. Granted, the > default congestion threshold is pretty high with modern memory sizes, so > it probably doesn't come into play much in practice, but removing it > would reduce some complexity in the client. I'd love to have some test that could reliably generate congestion and measure latencies for other IO. Without that, it is mostly guess work. So I cannot argue against your proposal, and do agree that removing the code would reduce complexity. I have no idea what the costs might be - if any. Hence my focus was on not changing behaviour. Thanks, NeilBrown