[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YFi8GYrRG/ks2BBz@stefanha-x1.localdomain>
Date: Mon, 22 Mar 2021 15:47:37 +0000
From: Stefan Hajnoczi <stefanha@...hat.com>
To: Connor Kuehl <ckuehl@...hat.com>
Cc: virtio-fs@...hat.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, vgoyal@...hat.com,
miklos@...redi.hu, jasowang@...hat.com, mst@...hat.com
Subject: Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size
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.
>
> 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.
>
> Furthermore, from section 2.6.5.3.1 (Driver Requirements: Indirect
> Descriptors) of the virtio spec:
>
> "A driver MUST NOT create a descriptor chain longer than the Queue
> Size of the device."
>
> 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.
>
> Signed-off-by: Connor Kuehl <ckuehl@...hat.com>
> ---
> 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 <stefanha@...hat.com>
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists