Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp634062pxb; Tue, 1 Feb 2022 07:23:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkDrYAbb0lEstvur3RbktLJkUwaVciH0BNPBAWFjiiUC31l90JPsJhjSnkhayWbj8o11Wm X-Received: by 2002:a05:6a00:190a:: with SMTP id y10mr25261999pfi.52.1643728995207; Tue, 01 Feb 2022 07:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643728995; cv=none; d=google.com; s=arc-20160816; b=EwEUE5mzasSB2tVhoHjXS48o9K1pVLwzEsHwBprnnFFXByA9yZ3Tv5lFdiGW6szOZ+ fGA/7g/8xWjHPB0gkGRECHnWfoPrWghP8lcOOXzvEi5EpyUhu53sMez6gCFPc7sPTSvE 5fMOha2ONmAdL3kRg7QXe3WaEqCTEULbplBGUZjNC0/c9DIqWMGjPcUAAhM5n+Qod3Ng o9t6TB48yL5PQUzijddOdGDIzNUkfY/yIzXiSYMAnZRjLXqGeOltcj5F7tS5MzWgKrYs Rwgfu4PBeO24I+hV2iLc7b+R0VzYse+WMfjZNJgPZzbF338hVehdljGINddfgVHBQF3Z 1AzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ES2qGLKjk4kMyKJP2zSqS3u5uFPSOTFVXfX3BK4dR8Q=; b=Pb8priea20oFDO2lJ5Cv3KXPKNskPP6qIsp9VoPvrWD1tEryOjfn2bwAgBDzWVfRZW 7qoM6rGcZ41Z4inLUzkjaSBju3K5KaFus9a6JfW9CMsn9Dvf+afZSCyM12l6iua0cDEp LN7iKPLvuu3ejBn3apLxU0Y+MIYaJOw/e5mQBSZIA/TlqfogxZxKmrYXBF+uUpc1TzFy SyZjlv/ne0QN291sY/NaP+IPYE/aPAU3lAfhVa+OS2hLrKTd6YegpE51YcCggRZAv/UW VThLwKrj98m0yYpZ6o15HX9+5AwzugvOEi3AuQY30TVeE8xl4sQr/t7MEMrZUIQPHgDW wbTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nOyiGMrY; 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 r7si2509976pjp.108.2022.02.01.07.23.03; Tue, 01 Feb 2022 07:23:15 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=nOyiGMrY; 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 S1357633AbiAaE2n (ORCPT + 99 others); Sun, 30 Jan 2022 23:28:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiAaE2l (ORCPT ); Sun, 30 Jan 2022 23:28:41 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D6EC061714; Sun, 30 Jan 2022 20:28:41 -0800 (PST) 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.