Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3544302pxf; Mon, 22 Mar 2021 08:52:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH/vMNm+3X7AJYB9iaXqwd7jjJj5SE/myLjfS9wgWv+mHwr0zrGPbYItgTmsMuR9daBsGF X-Received: by 2002:aa7:cd6a:: with SMTP id ca10mr196675edb.7.1616428341069; Mon, 22 Mar 2021 08:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616428341; cv=none; d=google.com; s=arc-20160816; b=VXgUxANaXXjzoBssH4RHMyf7Lxc2w3OusMYUCXdu9p1kN/0mB0L1yKHKi7J3EWIiJS TWmXTfN4Iuha6Wgf22lzqVcGcfnZE3DsUXKwiOOxeJqHswJuhSgvcb5lp3sFG+Jgcn8a oY56S68d+ElTi/Pp+bqsVmy9gdq/mQSb+jo1dfsAhbSZwqewTtVeQ0h1YvTPSjoJl+zY ix4bHLsMeUti514Xihf6K12TG5ipHgIY1mrrkKPzr9Rt2vcKqmtByRXJSNfShTv2xmdx Pq3XGFPTTajTASUSpogZTgcYRDpFoysi/9dEQcHo3W3VGVYs8beg5wl1kpJG2TnKm6IR gueg== 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=kF05X3XUjORG7bqce6qEvZk7r7MroqA/dhygkFI8iGg=; b=Cye6d+hQGuOoNUnf3uKcS0HFFr0mALhud35pRBuA2MJZIsj/6S7O6Q1sbpMLnnASO9 noeCy3XG6LRmQx+0KZ1oIzmXhXEMDr7kb3GXDAm+m9S540frZPTAzU+IZreu/SmOcWJc JASdx4SSMiCjKTAaFodQ7+O9u4cY+6FBySf8K8sIoD1VyUFFk4lj4oUDM+uxsh2n1die 80NtNLgubpztPenC+30FaMMaf+tUEmZCJPROhJm4ltd7AS18Ycdqwn+DSYmeAvSKrpCh ym3hI+7RLw/tQ2xT7UXv/wVZvboTQsL6KEXiJvxZbyviANs0OjvaCi1+cT1QNeu0TRJj NsGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IeRZBYFe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fy14si11374671ejb.533.2021.03.22.08.51.58; Mon, 22 Mar 2021 08:52:21 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=IeRZBYFe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbhCVPsd (ORCPT + 99 others); Mon, 22 Mar 2021 11:48:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37445 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbhCVPrw (ORCPT ); Mon, 22 Mar 2021 11:47:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616428072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kF05X3XUjORG7bqce6qEvZk7r7MroqA/dhygkFI8iGg=; b=IeRZBYFeFetQcdsGucuKf9kEuavOGe2SrkqfGac7b2lRpLTdXXN4/bzDq4vBboMKH3+bja YZvWoX+9Jh+5OnpRCwksSLeNhlXxK2yMtPLQEl/7UKB3CWV8EG6xFV2Cuw55TvGj0HNLxt AqfCBgibGpnD5gvYCsIp9s5Q4vK2YFE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-QYnxL-zNOQmSnNKMTqai6Q-1; Mon, 22 Mar 2021 11:47:48 -0400 X-MC-Unique: QYnxL-zNOQmSnNKMTqai6Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A541110866A9; Mon, 22 Mar 2021 15:47:46 +0000 (UTC) Received: from localhost (ovpn-114-89.ams2.redhat.com [10.36.114.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CEDF10023AB; Mon, 22 Mar 2021 15:47:39 +0000 (UTC) Date: Mon, 22 Mar 2021 15:47:37 +0000 From: Stefan Hajnoczi To: Connor Kuehl Cc: virtio-fs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, vgoyal@redhat.com, miklos@szeredi.hu, jasowang@redhat.com, mst@redhat.com Subject: Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size Message-ID: References: <20210318135223.1342795-1-ckuehl@redhat.com> <20210318135223.1342795-3-ckuehl@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EBlwIFYriryzFVKW" Content-Disposition: inline In-Reply-To: <20210318135223.1342795-3-ckuehl@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --EBlwIFYriryzFVKW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 18, 2021 at 08:52:22AM -0500, Connor Kuehl wrote: > If an incoming FUSE request can't fit on the virtqueue, the request is > placed onto a workqueue so a worker can try to resubmit it later where > there will (hopefully) be space for it next time. >=20 > This is fine for requests that aren't larger than a virtqueue's maximum > capacity. However, if a request's size exceeds the maximum capacity of > the virtqueue (even if the virtqueue is empty), it will be doomed to a > life of being placed on the workqueue, removed, discovered it won't fit, > and placed on the workqueue yet again. >=20 > Furthermore, from section 2.6.5.3.1 (Driver Requirements: Indirect > Descriptors) of the virtio spec: >=20 > "A driver MUST NOT create a descriptor chain longer than the Queue > Size of the device." >=20 > To fix this, limit the number of pages FUSE will use for an overall > request. This way, each request can realistically fit on the virtqueue > when it is decomposed into a scattergather list and avoid violating > section 2.6.5.3.1 of the virtio spec. >=20 > Signed-off-by: Connor Kuehl > --- > fs/fuse/fuse_i.h | 5 +++++ > fs/fuse/inode.c | 7 +++++++ > fs/fuse/virtio_fs.c | 14 ++++++++++++++ > 3 files changed, 26 insertions(+) Nice that FUSE already has max_pages :-). Reviewed-by: Stefan Hajnoczi --EBlwIFYriryzFVKW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmBYvBkACgkQnKSrs4Gr c8gL7Qf+MIRWqCCYkNEZwL6tftu8+lg4QxBigZvpmryZKX9xCLbLzcTZuUzPQC6I HiFj77t2jUhUbSv9edImKSWoSYad0kT0bCsWnwghojx+ta5lIXveKMwv4qHCkF9J CsnZqKYSW+9gCyjC/mCLLl1lHKSoSHJsDSVuJQ7gwlGg1n1Bv5IKE4ZX2+hlXGY3 FWtCTz17sqzrlCIceUnG5jN10TcXqsXSDEH3oOV6ZSWl8HTXWFyJjcRWau4u9S2R iIZJEcByDMVqWWCHWVySksdompYzM9xFbXLebPE5Rnn9BaK5m/BdISHbS1R5dZaU LPExG+DiEtEx/j/imqIq7YtJlXxA5g== =KXHl -----END PGP SIGNATURE----- --EBlwIFYriryzFVKW--