LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pankaj Gupta <pagupta@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: jack@suse.cz, kvm@vger.kernel.org, david@redhat.com,
linux-nvdimm@ml01.01.org, ross zwisler <ross.zwisler@intel.com>,
qemu-devel@nongnu.org, lcapitulino@redhat.com,
linux-mm@kvack.org, niteshnarayanlal@hotmail.com, mst@redhat.com,
hch@infradead.org, Stefan Hajnoczi <stefanha@gmail.com>,
marcel@redhat.com, nilal@redhat.com,
haozhong zhang <haozhong.zhang@intel.com>,
riel@surriel.com, pbonzini@redhat.com,
dan j williams <dan.j.williams@intel.com>,
kwolf@redhat.com,
xiaoguangrong eric <xiaoguangrong.eric@gmail.com>,
linux-kernel@vger.kernel.org, imammedo@redhat.com
Subject: Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver
Date: Sat, 28 Apr 2018 06:48:41 -0400 (EDT) [thread overview]
Message-ID: <1266554822.23475618.1524912521209.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180427133146.GB11150@stefanha-x1.localdomain>
> > > > + int err;
> > > > +
> > > > + sg_init_one(&sg, buf, sizeof(buf));
> > > > +
> > > > + err = virtqueue_add_outbuf(vpmem->req_vq, &sg, 1, buf, GFP_KERNEL);
> > > > +
> > > > + if (err) {
> > > > + dev_err(&vdev->dev, "failed to send command to virtio pmem
> > > > device\n");
> > > > + return;
> > > > + }
> > > > +
> > > > + virtqueue_kick(vpmem->req_vq);
> > >
> > > Is any locking necessary? Two CPUs must not invoke virtio_pmem_flush()
> > > at the same time. Not sure if anything guarantees this, maybe you're
> > > relying on libnvdimm but I haven't checked.
> >
> > I thought about it to some extent, and wanted to go ahead with simple
> > version first:
> >
> > - I think file 'inode -> locking' sill is there for request on single file.
> > - For multiple files, our aim is to just flush the backend block image.
> > - Even there is collision for virt queue read/write entry it should just
> > trigger a Qemu fsync.
> > We just want most recent flush to assure guest writes are synced
> > properly.
> >
> > Important point here: We are doing entire block fsync for guest virtual
> > disk.
>
> I don't understand your answer. Is locking necessary or not?
It will be required with other changes.
>
> From the virtqueue_add_outbuf() documentation:
>
> * Caller must ensure we don't call this with other virtqueue operations
> * at the same time (except where noted).
Yes, I also saw it. But thought if can avoid it with current functionality. :)
Thanks,
Pankaj
next prev parent reply other threads:[~2018-04-28 10:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 11:24 [RFC v2 0/2] kvm "fake DAX" device flushing Pankaj Gupta
2018-04-25 11:24 ` [RFC v2 1/2] virtio: add pmem driver Pankaj Gupta
2018-04-25 14:21 ` Dan Williams
2018-04-25 14:43 ` Dan Williams
2018-04-26 12:27 ` Jeff Moyer
2018-04-26 17:15 ` [Qemu-devel] " Pankaj Gupta
2018-04-26 17:24 ` Jeff Moyer
2018-04-25 14:52 ` Michael S. Tsirkin
2018-04-25 15:11 ` [Qemu-devel] " Pankaj Gupta
2018-04-26 13:12 ` Stefan Hajnoczi
2018-04-26 15:44 ` Pankaj Gupta
2018-04-27 13:31 ` Stefan Hajnoczi
2018-04-28 10:48 ` Pankaj Gupta [this message]
2018-04-25 11:24 ` [RFC v2 2/2] pmem: device flush over VIRTIO Pankaj Gupta
2018-04-25 14:23 ` Dan Williams
2018-04-25 14:47 ` Pankaj Gupta
2018-04-26 13:15 ` Stefan Hajnoczi
2018-04-26 16:40 ` Pankaj Gupta
2018-04-26 16:57 ` Dan Williams
2018-04-26 17:13 ` Pankaj Gupta
2018-04-25 11:24 ` [RFC v2] qemu: Add virtio pmem device Pankaj Gupta
2018-04-25 11:35 ` [Qemu-devel] " no-reply
2018-04-25 11:58 ` Pankaj Gupta
2018-04-25 14:23 ` Eric Blake
2018-04-25 14:51 ` Pankaj Gupta
2018-04-25 11:46 ` no-reply
2018-04-25 14:25 ` Eric Blake
2018-04-25 14:55 ` Pankaj Gupta
2018-04-26 13:24 ` Stefan Hajnoczi
2018-04-26 16:43 ` [Qemu-devel] " Pankaj Gupta
2018-06-01 12:24 ` [Qemu-devel] [RFC v2 0/2] kvm "fake DAX" device flushing Igor Mammedov
2018-06-04 5:56 ` Pankaj Gupta
2018-06-04 9:55 ` David Hildenbrand
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=1266554822.23475618.1524912521209.JavaMail.zimbra@redhat.com \
--to=pagupta@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=haozhong.zhang@intel.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-mm@kvack.org \
--cc=linux-nvdimm@ml01.01.org \
--cc=marcel@redhat.com \
--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@gmail.com \
--cc=stefanha@redhat.com \
--cc=xiaoguangrong.eric@gmail.com \
--subject='Re: [Qemu-devel] [RFC v2 1/2] virtio: add pmem driver' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).