Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp47912lqk; Wed, 13 Mar 2024 16:03:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5d3gh3dxdWAjoXXQMIbkJnjrlWzLRkcOZ4SnMAhDLj2XcmNLaIN5Vs8JsdX0PplzY80VciNq4h2ozKFFoYaXp4f6o0k51O89ZngLAqg== X-Google-Smtp-Source: AGHT+IEVuAPq1+wdiDkXSVFtU89bBa4npPVccEN+7/VC0p1EXDBv4rtqedcy7bNIgweluyBEp9RB X-Received: by 2002:a05:6a00:2190:b0:6e6:9f03:6a6d with SMTP id h16-20020a056a00219000b006e69f036a6dmr187862pfi.3.1710371019307; Wed, 13 Mar 2024 16:03:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710371019; cv=pass; d=google.com; s=arc-20160816; b=CuC1Z8DEa4KbDHgU/ShD8jtQgwcNRyJTZICZdBEo04MJ1C7J+byCciGedue2OuzFUz rhIjcfzFy3Box3oP8BDKwMfwjmg8WAFWP5R3QeVdhYVeL0h4e5E2KvYj7L/WTuIIeki3 ajvrFEB08LI/K4KYItZ7jHdYyL31152Hj2F2Zgi4gQQvzLp+Wfx4LxpTNHdEeRDnq93V 12urFmFYjRETMOWEP9+QN7DAOXJBYFBWHB44zzYqptOH4kOja6n45q5x6ZEWNlBdfUqW h9kGAb0WvEmDnaHzSBk1ejoNyLRlm8d2aFZHzNQRl/vJDaX7NAoK4upGmFWrQKOubVzg yNXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:feedback-id :dkim-signature:dkim-signature; bh=Bz4OSDL737dXWZswYNHf7v3iQ4bma+bPDF/AfKYK8vI=; fh=NGns7LoSUrZIiNEbAoE1td+FIOEog8XOTDMr8EBPGzQ=; b=B06cRdQ8jc5kuX/bEFj9r4xRoMWjoEFdx0q4A/q1QRIocZnf3wjke28D+7C732LI8F E4aR7zROXo9TLvYK3pd9G7O1wUw+JT0WAqv9tHoEBJOPTPgHuQSGspskOQyLFSMPIABT jR23MQ4m6DBOipfFhxV35HIXJe9FJ0SPHP+ciilas1twVnCijkcx6MT0dMo4XPhVtkT2 G8V5yv4EnRijz6VNOeMlK6zptHSvtbeGOTVZ19m03+GfXzfAkmaDYsjcBQ6pNhXIZI/i IMw6e6m6jRNnoGole6HAfJAlNWoMVf6TVumbLpp6lNA7ZkUUboA0m5nOob7VFfbMI7/z s6cA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fastmail.fm header.s=fm2 header.b=aE6FCaxf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Bg+P+DBt; arc=pass (i=1 spf=pass spfdomain=fastmail.fm dkim=pass dkdomain=fastmail.fm dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=fastmail.fm); spf=pass (google.com: domain of linux-kernel+bounces-102628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n64-20020a632743000000b005dc85a7bfe6si316483pgn.109.2024.03.13.16.03.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 16:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fastmail.fm header.s=fm2 header.b=aE6FCaxf; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Bg+P+DBt; arc=pass (i=1 spf=pass spfdomain=fastmail.fm dkim=pass dkdomain=fastmail.fm dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=fastmail.fm); spf=pass (google.com: domain of linux-kernel+bounces-102628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fastmail.fm Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 37644B23270 for ; Wed, 13 Mar 2024 23:03:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73F7F5D478; Wed, 13 Mar 2024 23:03:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b="aE6FCaxf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Bg+P+DBt" Received: from wfhigh7-smtp.messagingengine.com (wfhigh7-smtp.messagingengine.com [64.147.123.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC82842078; Wed, 13 Mar 2024 23:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710370982; cv=none; b=fycfXIVU5etgITPeoIt4lHMdlhZs0ZT58ixWkuCBblRiicy8jwPtiDn577weP3R0wrderOa15DW1yA7cpsMZ+ET7Da2AkwQ65NqlB4+DQFUpspMYKErPFMZwM/+0++jRokjcajdtjBjgEuarCGGvGWcyPWz8jzqCXSs8XOzuSg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710370982; c=relaxed/simple; bh=omms3SFurO0RSz7Vcb0yj6X1bkgms38UbPEuLlEOTOg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Xo4QwjPftNBrvPJ7c9clqfmK55WGxE32NCkunxctoPtUzbTFxlbowT0DCDQocLWkbnAA3Wt7OISy17PeCYnSfchLTGXpVBltSJhYpMgsBjU2E9SglKyKd1DI151fXRYzI88Z2V2IEBUgp+xipe+ozuzHv+vDiivNcDr7i6XDxEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.fm; spf=pass smtp.mailfrom=fastmail.fm; dkim=pass (2048-bit key) header.d=fastmail.fm header.i=@fastmail.fm header.b=aE6FCaxf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Bg+P+DBt; arc=none smtp.client-ip=64.147.123.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.fm Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.fm Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 388141800090; Wed, 13 Mar 2024 19:02:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 13 Mar 2024 19:02:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1710370977; x=1710457377; bh=Bz4OSDL737dXWZswYNHf7v3iQ4bma+bPDF/AfKYK8vI=; b= aE6FCaxfm+Xa6KPA6rEvpcPdrVzbm9+PjDYhWEMyXBXgIaY6mzWcHT7oCTjGSI90 Ur2imzdQKYPokhOpXSGpWwrPb6QY2QkjYCLDvAM7jGt/Af6U54PStQmIWcJbbZ1b KZ7Mmvd4dTskp1x/KLZ/NgJaNNL6sPKCQ3DsQsEpOWtQ5T8THYjyr+h0uFt3m70w Kn/epS80cNzapzq2aEUOFnmIdr5eMvnakl4DXwmRof9LfQjIxY3pNrMA4OIP8vKE b/RtD5fSKWywzkt0YOX35IEU8WwWnow4C8OZqWEtHN8NT+2k8SSWHnVrid8FnBVe g+3ifq733zXkNrB8M461gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710370977; x= 1710457377; bh=Bz4OSDL737dXWZswYNHf7v3iQ4bma+bPDF/AfKYK8vI=; b=B g+P+DBtnuUCigeIBzC+2RyT/kLAJjW7Se2HVhtZi6vYnUDRryAwDXi8kM55AvdCF rapFWUbusKa5CJiaK/TqyZpeJ7G/dEjGOw3wnFZFe9bGw8cRo/Xv5Zve5v+IFffW +KDGasTsw5eMRjHqLCSoNSigKsbCNL0Qe8P5mxE/Nb4vhh+7Vw2CFHRucVJ4CXEg qLpcDKRHPy4WP73/BKepww4NZixnzySRSy86MOHKUuOs93MPbp9l9461wkL8BzQ+ f0VH3Mw+h07ySWWKslZLBWgoG4Qdz6O8Kx1mj0t/JH2ZcUok8t75NPCvNVNbCqoA VsmtEBoUT0Yqwd/CJoiRA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeeigddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepuegvrhhn ugcuufgthhhusggvrhhtuceosggvrhhnugdrshgthhhusggvrhhtsehfrghsthhmrghilh drfhhmqeenucggtffrrghtthgvrhhnpeevhffgvdeltddugfdtgfegleefvdehfeeiveej ieefveeiteeggffggfeulefgjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegsvghrnhgurdhstghhuhgsvghrthesfhgrshhtmhgrihhlrdhf mh X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Mar 2024 19:02:55 -0400 (EDT) Message-ID: Date: Thu, 14 Mar 2024 00:02:52 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/6] fuse: limit the length of ITER_KVEC dio by max_pages Content-Language: en-US, de-DE, fr To: Hou Tao , Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, Vivek Goyal , Stefan Hajnoczi , "Michael S . Tsirkin" , Matthew Wilcox , Benjamin Coddington , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, houtao1@huawei.com References: <20240228144126.2864064-1-houtao@huaweicloud.com> <20240228144126.2864064-2-houtao@huaweicloud.com> <8f21c92f-5456-7a2e-59af-1a02d8a10c24@huaweicloud.com> From: Bernd Schubert In-Reply-To: <8f21c92f-5456-7a2e-59af-1a02d8a10c24@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/9/24 05:26, Hou Tao wrote: > Hi, > > On 3/1/2024 9:42 PM, Miklos Szeredi wrote: >> On Wed, 28 Feb 2024 at 15:40, Hou Tao wrote: >> >>> So instead of limiting both the values of max_read and max_write in >>> kernel, capping the maximal length of kvec iter IO by using max_pages in >>> fuse_direct_io() just like it does for ubuf/iovec iter IO. Now the max >>> value for max_pages is 256, so on host with 4KB page size, the maximal >>> size passed to kmalloc() in copy_args_to_argbuf() is about 1MB+40B. The >>> allocation of 2MB of physically contiguous memory will still incur >>> significant stress on the memory subsystem, but the warning is fixed. >>> Additionally, the requirement for huge physically contiguous memory will >>> be removed in the following patch. >> So the issue will be fixed properly by following patches? >> >> In that case this patch could be omitted, right? > > Sorry for the late reply. Being busy with off-site workshop these days. > > No, this patch is still necessary and it is used to limit the number of > scatterlist used for fuse request and reply in virtio-fs. If the length > of out_args[0].size is not limited, the number of scatterlist used to > map the fuse request may be greater than the queue size of virtio-queue > and the fuse request may hang forever. I'm currently also totally busy and didn't carefully check, but isn't there something missing that limits fc->max_write/fc->max_read? Thanks, Bernd