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 BEFA8C433F5 for ; Mon, 31 Jan 2022 04:28:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 152756B0073; Sun, 30 Jan 2022 23:28:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 102996B0095; Sun, 30 Jan 2022 23:28:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F32696B0098; Sun, 30 Jan 2022 23:28:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id E203C6B0073 for ; Sun, 30 Jan 2022 23:28:39 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 904718249980 for ; Mon, 31 Jan 2022 04:28:39 +0000 (UTC) X-FDA: 79089301158.13.2B30F5C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 4610140002 for ; Mon, 31 Jan 2022 04:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ES2qGLKjk4kMyKJP2zSqS3u5uFPSOTFVXfX3BK4dR8Q=; b=nOyiGMrYnkL+cwvfxXygFZ0+pe IFhK0DanjYrlTWy2+2tJ0Fv5NYmVsHmrEg8r3Tv7fUWI7zSsVRDC5KXHQXmYtz1fyZ1AxVVixOnT/ 80XbkI+T3/PzAUQcnwieiIW0EY3cnC0Izgv2gH8DefwqBUKVQXfMKxB0SRyMKF4wS80AAjI4RW4qo AegECF3AFlMGMPv4gkAI1YJwN5Z0iY4W7ixlA39NqIwt5cV4BHiMS/813+j+MELpIGzdKjkGDM7Or vhpU5p8MXT5Q8UAkIGfSdIIFi8sts1jlCtbZU73uVhbG3ZNP8eUrEY5Tr8LQee4DkL4D750dxV9st JYF3cT9w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEOIp-009GEh-4h; Mon, 31 Jan 2022 04:28:31 +0000 Date: Mon, 31 Jan 2022 04:28:31 +0000 From: Matthew Wilcox To: NeilBrown Cc: Andrew Morton , Jeff Layton , Ilya Dryomov , Miklos Szeredi , Trond Myklebust , Anna Schumaker , linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] fuse: remove reliance on bdi congestion Message-ID: References: <164360127045.4233.2606812444285122570.stgit@noble.brown> <164360183348.4233.761031466326833349.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164360183348.4233.761031466326833349.stgit@noble.brown> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4610140002 X-Stat-Signature: 94111h96y638zoktymjddmte1egw7he1 X-Rspam-User: nil Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nOyiGMrY; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1643603319-859493 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 Mon, Jan 31, 2022 at 03:03:53PM +1100, NeilBrown wrote: > diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c > index 182b24a14804..5f74e2585f50 100644 > --- a/fs/fuse/dax.c > +++ b/fs/fuse/dax.c > @@ -781,6 +781,9 @@ static int fuse_dax_writepages(struct address_space *mapping, > struct inode *inode = mapping->host; > struct fuse_conn *fc = get_fuse_conn(inode); > > + if (wbc->sync_mode == WB_SYNC_NONE && > + fc->num_background >= fc->congestion_threshold) > + return 0; > return dax_writeback_mapping_range(mapping, fc->dax->dev, wbc); This makes no sense. Doing writeback for DAX means flushing the CPU cache (in a terribly inefficient way), but it's not going to be doing anything in the background; it's a sync operation. > +++ b/fs/fuse/file.c > @@ -958,6 +958,8 @@ static void fuse_readahead(struct readahead_control *rac) > > if (fuse_is_bad(inode)) > return; > + if (fc->num_background >= fc->congestion_threshold) > + return; This seems like a bad idea to me. If we don't even start reads on readahead pages, they'll get ->readpage called on them one at a time and the reading thread will block. It's going to lead to some nasty performance problems, exactly when you don't want them. Better to queue the reads internally and wait for congestion to ease before submitting the read.