All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Gupta <pagupta@redhat.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KVM list <kvm@vger.kernel.org>,
	Qemu Developers <qemu-devel@nongnu.org>,
	linux-nvdimm <linux-nvdimm@ml01.01.org>, Jan Kara <jack@suse.cz>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Rik van Riel <riel@surriel.com>,
	Nitesh Narayan Lal <nilal@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ross Zwisler <ross.zwisler@intel.com>,
	David Hildenbrand <david@redhat.com>,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	niteshnarayanlal@hotmail.com, lcapitulino@redhat.com,
	Igor Mammedov <imammedo@redhat.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH 3/3] virtio-pmem: Add virtio pmem driver
Date: Thu, 27 Sep 2018 09:06:40 -0400 (EDT)	[thread overview]
Message-ID: <435471901.16563045.1538053600799.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1204243972.15515798.1537782119951.JavaMail.zimbra@redhat.com>


Hello Dan,

> > > + /* The request submission function */
> > > +static int virtio_pmem_flush(struct nd_region *nd_region)
> > > +{
> > > +       int err;

[...]

> > > +       init_waitqueue_head(&req->host_acked);
> > > +       init_waitqueue_head(&req->wq_buf);
> > > +
> > > +       spin_lock_irqsave(&vpmem->pmem_lock, flags);
> > > +       sg_init_one(&sg, req->name, strlen(req->name));
> > > +       sgs[0] = &sg;
> > > +       sg_init_one(&ret, &req->ret, sizeof(req->ret));
> > > +       sgs[1] = &ret;

[...]
> > > +       spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
> > > +       /* When host has read buffer, this completes via host_ack */
> > > +       wait_event(req->host_acked, req->done);
> > 
> > Hmm, this seems awkward if this is called from pmem_make_request. If
> > we need to wait for completion that should be managed by the guest
> > block layer. I.e. make_request should just queue request and then
> > trigger bio_endio() when the response comes back.
> 
> We are plugging VIRTIO based flush callback for virtio_pmem driver. If pmem
> driver (pmem_make_request) has to queue request we have to plug "blk_mq_ops"
> callbacks for corresponding  VIRTIO vqs. AFAICU there is no existing
> multiqueue
> code merged for pmem driver yet, though i could see patches by Dave upstream.
> 

I thought about this and with current infrastructure "make_request" releases spinlock 
and makes current thread/task. All Other threads are free to call 'make_request'/flush 
and similarly wait by releasing the lock. This actually works like a queue of threads 
waiting for notifications from host.

Current pmem code do not have multiqueue support and I am not sure if core pmem code 
needs it. Adding multiqueue support just for virtio-pmem and not for pmem in same driver
will be confusing or require alot of tweaking.

Could you please give your suggestions on this. 
 
Thanks,
Pankaj

  reply	other threads:[~2018-09-27 13:06 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 13:30 [PATCH 0/3] kvm "fake DAX" device Pankaj Gupta
2018-08-31 13:30 ` [Qemu-devel] " Pankaj Gupta
2018-08-31 13:30 ` Pankaj Gupta
     [not found] ` <20180831133019.27579-1-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-08-31 13:30   ` [PATCH 1/3] nd: move nd_region to common header Pankaj Gupta
2018-08-31 13:30     ` [Qemu-devel] " Pankaj Gupta
2018-08-31 13:30     ` Pankaj Gupta
     [not found]     ` <20180831133019.27579-2-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-22  0:47       ` Dan Williams
2018-09-22  0:47         ` Dan Williams
     [not found]         ` <CAPcyv4jFimkVnVuzza5TCG=KvY88KZnXzH4GNEgUBbTouprzJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-24 11:40           ` Pankaj Gupta
2018-09-24 11:40             ` Pankaj Gupta
2018-08-31 13:30   ` [PATCH 2/3] libnvdimm: nd_region flush callback support Pankaj Gupta
2018-08-31 13:30     ` [Qemu-devel] " Pankaj Gupta
2018-08-31 13:30     ` Pankaj Gupta
2018-09-04 15:29     ` kbuild test robot
2018-09-04 15:29       ` [Qemu-devel] " kbuild test robot
2018-09-04 15:29       ` kbuild test robot
     [not found]       ` <20180904152917.GE17047-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-09-05  8:40         ` Pankaj Gupta
2018-09-05  8:40           ` [Qemu-devel] " Pankaj Gupta
2018-09-05  8:40           ` Pankaj Gupta
2018-09-22  0:43     ` Dan Williams
2018-09-24 11:07       ` Pankaj Gupta
2018-08-31 13:30   ` [PATCH 3/3] virtio-pmem: Add virtio pmem driver Pankaj Gupta
2018-08-31 13:30     ` [Qemu-devel] " Pankaj Gupta
2018-08-31 13:30     ` Pankaj Gupta
     [not found]     ` <20180831133019.27579-4-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-04 15:17       ` kbuild test robot
2018-09-04 15:17         ` [Qemu-devel] " kbuild test robot
2018-09-04 15:17         ` kbuild test robot
2018-09-05  8:34         ` Pankaj Gupta
2018-09-05  8:34           ` [Qemu-devel] " Pankaj Gupta
2018-09-05 12:02       ` kbuild test robot
2018-09-05 12:02         ` [Qemu-devel] " kbuild test robot
2018-09-05 12:02         ` kbuild test robot
2018-09-12 16:54       ` Luiz Capitulino
2018-09-12 16:54         ` [Qemu-devel] " Luiz Capitulino
2018-09-12 16:54         ` Luiz Capitulino
2018-09-13  6:58         ` [Qemu-devel] " Pankaj Gupta
2018-09-13  6:58           ` Pankaj Gupta
     [not found]           ` <831225077.12817716.1536821901550.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-13 12:19             ` Luiz Capitulino
2018-09-13 12:19               ` Luiz Capitulino
2018-09-14 12:13               ` Pankaj Gupta
2018-09-22  1:08       ` Dan Williams
2018-09-22  1:08         ` Dan Williams
2018-09-24  9:41         ` Pankaj Gupta
2018-09-27 13:06           ` Pankaj Gupta [this message]
2018-09-27 15:55             ` Dan Williams
2018-08-31 13:30   ` [PATCH] qemu: Add virtio pmem device Pankaj Gupta
2018-08-31 13:30     ` [Qemu-devel] " Pankaj Gupta
2018-08-31 13:30     ` Pankaj Gupta
     [not found]     ` <20180831133019.27579-5-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-12 16:57       ` Luiz Capitulino
2018-09-12 16:57         ` [Qemu-devel] " Luiz Capitulino
2018-09-12 16:57         ` Luiz Capitulino
2018-09-13  7:06         ` Pankaj Gupta
2018-09-13  7:06           ` [Qemu-devel] " Pankaj Gupta
2018-09-13  7:06           ` Pankaj Gupta
     [not found]           ` <563893075.12819183.1536822387535.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-13 12:22             ` Luiz Capitulino
2018-09-13 12:22               ` [Qemu-devel] " Luiz Capitulino
2018-09-13 12:22               ` Luiz Capitulino
2018-09-20 11:21     ` David Hildenbrand
     [not found]       ` <2721c3ee-88d1-a8e9-1f1e-ffc3eef1d1ca-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-20 12:03         ` [Qemu-devel] " Pankaj Gupta
2018-09-20 12:03           ` Pankaj Gupta

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=435471901.16563045.1538053600799.JavaMail.zimbra@redhat.com \
    --to=pagupta@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hch@infradead.org \
    --cc=imammedo@redhat.com \
    --cc=jack@suse.cz \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=mst@redhat.com \
    --cc=nilal@redhat.com \
    --cc=niteshnarayanlal@hotmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riel@surriel.com \
    --cc=ross.zwisler@intel.com \
    --cc=stefanha@redhat.com \
    --cc=xiaoguangrong.eric@gmail.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.