Re: [RFC 2/2] KVM: add virtio-pmem driver

From: Pankaj Gupta
Date: Thu Oct 12 2017 - 18:39:19 EST


> > > >
> > > > > > Â This patch adds virtio-pmem driver for KVM guest.
> > > > > > Â Guest reads the persistent memory range information
> > > > > > Â over virtio bus from Qemu and reserves the range
> > > > > > Â as persistent memory. Guest also allocates a block
> > > > > > Â device corresponding to the pmem range which later
> > > > > > Â can be accessed with DAX compatible file systems.
> > > > > > Â Idea is to use the virtio channel between guest and
> > > > > > Â host to perform the block device flush for guest pmem
> > > > > > Â DAX device.
> > > > > >
> > > > > > Â There is work to do including DAX file system support
> > > > > > Â and other advanced features.
> > > > > >
> > > > > > Signed-off-by: Pankaj Gupta <pagupta@xxxxxxxxxx>
> > > > > > ---
> > > > > > Âdrivers/virtio/KconfigÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ10 ++
> > > > > > Âdrivers/virtio/MakefileÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> > > > > > Âdrivers/virtio/virtio_pmem.cÂÂÂÂÂ| 322
> > > > > > Â+++++++++++++++++++++++++++++++++++++++
> > > > > > Âinclude/uapi/linux/virtio_pmem.h |ÂÂ55 +++++++
> > > > > > Â4 files changed, 388 insertions(+)
> > > > > > Âcreate mode 100644 drivers/virtio/virtio_pmem.c
> > > > > > Âcreate mode 100644 include/uapi/linux/virtio_pmem.h
> > > > > >
> > > > > > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> > > > > > index cff773f15b7e..0192c4bda54b 100644
> > > > > > --- a/drivers/virtio/Kconfig
> > > > > > +++ b/drivers/virtio/Kconfig
> > > > > > @@ -38,6 +38,16 @@ config VIRTIO_PCI_LEGACY
> > > > > >
> > > > > > ÂÂÂÂÂÂÂÂÂÂIf unsure, say Y.
> > > > > >
> > > > > > +config VIRTIO_PMEM
> > > > > > +ÂÂÂÂÂÂÂtristate "Virtio pmem driver"
> > > > > > +ÂÂÂÂÂÂÂdepends on VIRTIO
> > > > > > +ÂÂÂÂÂÂÂ---help---
> > > > > > +ÂÂÂÂÂÂÂÂThis driver adds persistent memory range within a
> > > > > > KVM guest.
>
> With "Virtio Block Backed Pmem" we could name the config
> option VIRTIO_BLOCK_PMEM
>
> The documentation text could make it clear to people that the
> image shows up as a disk image on the host, but as a pmem
> memory range in the guest.

yes, this looks better.
thank you.

>
> > > > > I think we need to call this something other than persistent
> > > > > memory to
> > > > > make it clear that this not memory where the persistence can be
> > > > > managed from userspace. The persistence point always requires
> > > > >
> > > So currently /proc/iomem in a guest with a pmem device attached to
> > > a
> > > namespace looks like this:
> > >
> > > ÂÂÂÂc00000000-13bfffffff : Persistent Memory
> > > ÂÂÂÂÂÂÂc00000000-13bfffffff : namespace2.0
> > >
> > > Can we call it "Virtio Shared Memory" to make it clear it is a
> > > different beast than typical "Persistent Memory"?ÂÂYou can likely
> >
> > I think somewhere we need persistent keyword 'Virtio Persistent
> > Memory' or
> > so.
>
> Still hoping for better ideas than "Virtio Block Backed Pmem" :)

:-)
>