From: Vivek Goyal <vgoyal@redhat.com>
To: Chirantan Ekbote <chirantan@chromium.org>
Cc: "virtio-fs@redhat.com" <virtio-fs@redhat.com>,
"misono.tomohiro@fujitsu.com" <misono.tomohiro@fujitsu.com>,
"masayoshi.mizuma@fujitsu.com" <masayoshi.mizuma@fujitsu.com>
Subject: Re: [Virtio-fs] xfstest results for virtio-fs on aarch64
Date: Fri, 11 Oct 2019 16:36:47 -0400 [thread overview]
Message-ID: <20191011203647.GC13861@redhat.com> (raw)
In-Reply-To: <CAJFHJrq6bQo=yvO0tAxH7RWg=U=ftpsePs3c7y-AcE90Wh4afg@mail.gmail.com>
On Sat, Oct 12, 2019 at 05:13:51AM +0900, Chirantan Ekbote wrote:
> On Sat, Oct 12, 2019 at 4:59 AM Vivek Goyal <vgoyal@redhat.com> wrote:
> >
> > On Sat, Oct 12, 2019 at 03:45:01AM +0900, Chirantan Ekbote wrote:
> > > This is unrelated but there's also a nullptr dereference in the driver
> > > if the device advertises more than request queue. This is problematic
> > > code:
> > >
> > > /* Allocate fuse_dev for hiprio and notification queues */
> > > for (i = 0; i < VQ_REQUEST; i++) {
> > > struct virtio_fs_vq *fsvq = &fs->vqs[i];
> > >
> > > fsvq->fud = fuse_dev_alloc();
> > > if (!fsvq->fud)
> > > goto err_free_fuse_devs;
> > > }
> > >
> > > ctx.fudptr = (void **)&fs->vqs[VQ_REQUEST].fud;
> > > err = fuse_fill_super_common(sb, &ctx);
> > > if (err < 0)
> > > goto err_free_fuse_devs;
> > >
> > > fc = fs->vqs[VQ_REQUEST].fud->fc;
> > >
> > > for (i = 0; i < fs->nvqs; i++) {
> > > struct virtio_fs_vq *fsvq = &fs->vqs[i];
> > >
> > > if (i == VQ_REQUEST)
> > > continue; /* already initialized */
> > > fuse_dev_install(fsvq->fud, fc);
> > > }
> > >
> > > The first loop only initializes fsvq->fud for queues up to VQ_REQUEST
> > > but then the second loop calls fuse_dev_install with fsvq->fud for all
> > > queues up to fs->nvqs. When fs->nvqs is greater than VQ_REQUEST this
> > > will end up dereferencing an uninitialized pointer. I think the fix
> > > is to skip calling fuse_dev_alloc for the VQ_REQUEST queue but then
> > > call it for all the other queues up to fs->nvqs.
> >
> > Right now we support only 1 request queue and multi queue support is
> > not there. Planning to add multiqueue support in future releases though.
> >
>
> Could you elaborate on what is missing for multiqueue support? For
> reference, this patch was enough to get it working for me:
May be not much is missing. Just that were focussed on first getting a
basic version of virtiofs upstream and then start looking at performance
improvement features.
>
> @@ -922,7 +990,8 @@ static int virtio_fs_enqueue_req(struct virtqueue
> *vq, struct fuse_req *req)
> static void virtio_fs_wake_pending_and_unlock(struct fuse_iqueue *fiq)
> __releases(fiq->waitq.lock)
> {
> - unsigned queue_id = VQ_REQUEST; /* TODO multiqueue */
> + /* unsigned queue_id = VQ_REQUEST; /\* TODO multiqueue *\/ */
> + unsigned queue_id;
> struct virtio_fs *fs;
> struct fuse_conn *fc;
> struct fuse_req *req;
> @@ -937,6 +1006,7 @@ __releases(fiq->waitq.lock)
> spin_unlock(&fiq->waitq.lock);
>
> fs = fiq->priv;
> + queue_id = (req->in.h.unique % (fs->nvqs - 1)) + 1;
> fc = fs->vqs[queue_id].fud->fc;
>
> dev_dbg(&fs->vqs[queue_id].vq->vdev->dev,
>
>
> This is simply round-robin scheduling but even going from one to two
> queues gives a significant performance improvement (especially because
> crosvm doesn't support shared memory regions yet).
Interesting. I thought virtiofsd is hard coded right now to support
only one queue. Did you modify virtiofsd to support more than one
request queue?
Can you give some concrete numbers. How much performance improvement
do you see with multiqueue. What workload you are using for testing.
Thanks
Vivek
next prev parent reply other threads:[~2019-10-11 20:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-07 12:11 [Virtio-fs] xfstest results for virtio-fs on aarch64 qi.fuli
2019-10-07 14:34 ` Dr. David Alan Gilbert
2019-10-09 16:51 ` Dr. David Alan Gilbert
2019-10-10 9:57 ` qi.fuli
2019-10-11 9:21 ` Dr. David Alan Gilbert
2019-10-11 18:45 ` Chirantan Ekbote
2019-10-11 19:59 ` Vivek Goyal
2019-10-11 20:13 ` Chirantan Ekbote
2019-10-11 20:36 ` Vivek Goyal [this message]
2019-10-14 9:11 ` Stefan Hajnoczi
2019-10-15 14:58 ` Chirantan Ekbote
2019-10-15 15:57 ` Dr. David Alan Gilbert
2019-10-15 16:11 ` Chirantan Ekbote
2019-10-15 16:26 ` Dr. David Alan Gilbert
2019-10-15 17:28 ` Boeuf, Sebastien
2019-10-15 18:21 ` Chirantan Ekbote
2019-10-16 14:14 ` Stefan Hajnoczi
2019-10-16 16:14 ` Boeuf, Sebastien
2019-10-16 18:38 ` Stefan Hajnoczi
2019-10-17 5:19 ` Boeuf, Sebastien
2019-11-01 22:26 ` Boeuf, Sebastien
2019-11-12 9:45 ` Stefan Hajnoczi
[not found] ` <5238b860a8d544e59c9a827fbc26418d53482ccf.camel@intel.com>
2019-11-13 11:39 ` Stefan Hajnoczi
2019-11-20 16:53 ` Dr. David Alan Gilbert
2019-10-16 16:11 ` Boeuf, Sebastien
2019-10-16 18:37 ` Stefan Hajnoczi
2019-10-16 14:09 ` Stefan Hajnoczi
2019-10-16 19:36 ` Chirantan Ekbote
2019-10-16 19:44 ` Vivek Goyal
2019-10-17 9:23 ` Stefan Hajnoczi
2019-11-06 12:13 ` Dr. David Alan Gilbert
2019-11-07 8:03 ` misono.tomohiro
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=20191011203647.GC13861@redhat.com \
--to=vgoyal@redhat.com \
--cc=chirantan@chromium.org \
--cc=masayoshi.mizuma@fujitsu.com \
--cc=misono.tomohiro@fujitsu.com \
--cc=virtio-fs@redhat.com \
/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.