From: Stefan Hajnoczi <stefanha@redhat.com>
To: Peter-Jan Gootzen <peter-jan@gootzen.net>
Cc: miklos@szeredi.hu, vgoyal@redhat.com,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio-fs: Improved request latencies when Virtio queue is full
Date: Tue, 23 May 2023 17:03:35 -0400 [thread overview]
Message-ID: <20230523210335.GA141797@fedora> (raw)
In-Reply-To: <20230522131915.114534-1-peter-jan@gootzen.net>
[-- Attachment #1.1: Type: text/plain, Size: 1597 bytes --]
On Mon, May 22, 2023 at 03:19:15PM +0200, Peter-Jan Gootzen wrote:
> When the Virtio queue is full, a work item is scheduled
> to execute in 1ms that retries adding the request to the queue.
> This is a large amount of time on the scale on which a
> virtio-fs device can operate. When using a DPU this is around
> 40us baseline without going to a remote server (4k, QD=1).
> This patch queues requests when the Virtio queue is full,
> and when a completed request is taken off, immediately fills
> it back up with queued requests.
>
> This reduces the 99.9th percentile latencies in our tests by
> 60x and slightly increases the overall throughput, when using a
> queue depth 2x the size of the Virtio queue size, with a
> DPU-powered virtio-fs device.
>
> Signed-off-by: Peter-Jan Gootzen <peter-jan@gootzen.net>
> ---
> fs/fuse/virtio_fs.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index 4d8d4f16c727..8af9d3dc61d3 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -347,6 +347,8 @@ static void virtio_fs_hiprio_done_work(struct work_struct *work)
> }
> } while (!virtqueue_enable_cb(vq) && likely(!virtqueue_is_broken(vq)));
> spin_unlock(&fsvq->lock);
> +
> + schedule_delayed_work(&fsvq->dispatch_work, 0);
This avoids scheduling work when there is nothing queued and uses
schedule_work() since there is no timeout value:
if (!list_empty(&fsvq->queued_reqs)) {
schedule_work(&fsvq->dispatch_work);
}
spin_unlock(&fsvq->lock);
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
prev parent reply other threads:[~2023-05-23 21:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 13:19 [PATCH] virtio-fs: Improved request latencies when Virtio queue is full Peter-Jan Gootzen via Virtualization
2023-05-23 21:03 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230523210335.GA141797@fedora \
--to=stefanha@redhat.com \
--cc=miklos@szeredi.hu \
--cc=peter-jan@gootzen.net \
--cc=vgoyal@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.