Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp680809pxb; Tue, 1 Feb 2022 08:15:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCTqQ87ZPwYoVX3fap05vJM7+ykJ+YTgF3gzarHpvmWoHbTuS/iMky/77jkovkkJx2dMtu X-Received: by 2002:a65:4bc9:: with SMTP id p9mr21024383pgr.168.1643732101037; Tue, 01 Feb 2022 08:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643732101; cv=none; d=google.com; s=arc-20160816; b=VN//bFQJAiq2OeH3+o0QbRKiox6wRqbEjFKfIN2FstSJ8dVEO7GJ1qcvknZRSFYvDF 65Q/h1jeF7KsR0R/nCVGjtVwuRqiuNloKRSSkgYM2wV/7tmEzeiCXRUJgSsi5gUwgx42 6vL8XXA0EQEga0TDJZckBr+H5Nt9CQBGJ0g6oT+bOCvMgQwePbwvPBLoOl4G6ZdhbP08 D52uvfoY/1yx5BZ78/Qokabsw2vfl9kLFOcxMYRY8812AhyvWi5w/rSRSe/HxjlPLqAd gYdnVDXhDmMdXZ7TucWj69XnSJytdC71+Uez/podzhJHbye9mTSghxAdq0mf7/9BT5qI k4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3Lm3cgz6DtmL9tpisEfrfuo7Wj8QCaI1ocVGLYB2Y2U=; b=Wic8Q1Qz9hHa4X1nzSqGppAJsjgOC8SWjDuMha8z/Gy/2KvNCDB80nXS702z8riXKT V9Le3nJGEogElfiF7SMiP79u/xjz/9t5LJfckwpTaPne+HQHbOc5ASGOO3VQtcwXwLw8 nq2OOdQyDvUpHXUu+OaDU5+uke2vG/x5eaUk4SGX7pIBDllypjsMXn3B3L0zrm92Pp+/ Fv4eCxO6f+oCWE2DJsXv/NZ6J9xEhXhcPFgcri2l+wf+E5Em/8685eY11rZqobK1xeGz 3dLrfgzHN9ZFB5hTczUNXW/2uKJsrWGgvHYclijMIv8jnDs7YAGgo6ESCoSjduZWdQsd rhWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="Lind02/N"; 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 u13si1330191plq.369.2022.02.01.08.14.46; Tue, 01 Feb 2022 08:15:00 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="Lind02/N"; 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 S1348432AbiAaKVj (ORCPT + 99 others); Mon, 31 Jan 2022 05:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358090AbiAaKVf (ORCPT ); Mon, 31 Jan 2022 05:21:35 -0500 Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 201F4C06173D for ; Mon, 31 Jan 2022 02:21:35 -0800 (PST) Received: by mail-vk1-xa31.google.com with SMTP id y192so7920368vkc.8 for ; Mon, 31 Jan 2022 02:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3Lm3cgz6DtmL9tpisEfrfuo7Wj8QCaI1ocVGLYB2Y2U=; b=Lind02/Njzrr7eWAupL32iIHm4GhlbxdTkXaEnTW2OV0dgNWX/rudjG6+pcPbPpIFq C69XJIFu0uAQHgKg9yzKqDEaKe2dTryF/XVS7u5Fs51eNy1ypgdGDsx2HWFQUKmKA/Qj gsFWvFnWm3m6cKgmcrNeOadSQiHcKT9p9vJ3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Lm3cgz6DtmL9tpisEfrfuo7Wj8QCaI1ocVGLYB2Y2U=; b=kPLfGQlL26OEgNI8LOSezyCHYD5cZSVSRQPYZkpA6uuddRd/JsP3SCdqeBN6OPavuy iQTbNi0Sy0i459D3obzj9CZvEZxE6IT0fQCCu7UwnoAEJo6Kpa/kN4nSiT78s44sO8Uz zOdrDPoh1csJCnGyDqwX6vPEhAWt/D1lySF49xOABq55rVo8NhtPZJdYL3yhTR1YfYo1 goI3O0n44IFustb2zM5ZO1QPKkMx7jUFYAJjTmuizy7V8W0dH9/BLlQ/EKi+aBkWTUY+ H84xzZVqloCTzO6kO9iwu+XqkZHzLjDq+saJfbE56minJMfMNHSv7mStESI/MPMGxECz Mmkg== X-Gm-Message-State: AOAM531cgwS4D/1DfVT4eXG+tPyv5EZv5sUv2NmIvFGP2c0VWwsjJt5G IOrRtmD2srfCHlh1Skh+i69aSLzgStEd646xnSwT2g== X-Received: by 2002:a1f:a753:: with SMTP id q80mr8215440vke.1.1643624494313; Mon, 31 Jan 2022 02:21:34 -0800 (PST) MIME-Version: 1.0 References: <164360127045.4233.2606812444285122570.stgit@noble.brown> <164360183348.4233.761031466326833349.stgit@noble.brown> <164360446180.18996.6767388833611575467@noble.neil.brown.name> In-Reply-To: <164360446180.18996.6767388833611575467@noble.neil.brown.name> From: Miklos Szeredi Date: Mon, 31 Jan 2022 11:21:23 +0100 Message-ID: Subject: Re: [PATCH 1/3] fuse: remove reliance on bdi congestion To: NeilBrown Cc: Matthew Wilcox , Andrew Morton , Jeff Layton , Ilya Dryomov , Trond Myklebust , Anna Schumaker , linux-mm , Linux NFS list , linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 Jan 2022 at 05:47, NeilBrown wrote: > > > +++ 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. > > > > Isn't that exactly what happens now? page_cache_async_ra() sees that > inode_read_congested() returns true, so it doesn't start readahead. > ??? I agree. Fuse throttles async requests even before allocating them, which precludes placing them on any queue. I guess it was done to limit the amount of kernel memory pinned by a task (sync requests allow just one request per task). This has worked well, and I haven't heard complaints about performance loss due to readahead throttling. Thanks, Miklos