Re: [Qemu-devel] [RFC v2 0/2] kvm "fake DAX" device flushing

2018-06-04 Thread David Hildenbrand
On 01.06.2018 14:24, Igor Mammedov wrote:
> On Wed, 25 Apr 2018 16:54:12 +0530
> Pankaj Gupta  wrote:
> 
> [...]
>> - Qemu virtio-pmem device
>>   It exposes a persistent memory range to KVM guest which 
>>   at host side is file backed memory and works as persistent 
>>   memory device. In addition to this it provides virtio 
>>   device handling of flushing interface. KVM guest performs
>>   Qemu side asynchronous sync using this interface.
> a random high level question,
> Have you considered using a separate (from memory itself)
> virtio device as controller for exposing some memory, async flushing.
> And then just slaving pc-dimm devices to it with notification/ACPI
> code suppressed so that guest won't touch them?

I don't think slaving pc-dimm would be the right thing to do (e.g.
slots, pcdimm vs nvdimm, bus(less), etc..). However the general idea is
interesting for virtio-pmem (as we might have a bigger number of disks).

We could have something like a virtio-pmem-bus to which you attach
virtio-pmem devices. By specifying the mapping, e.g. the thread that
will be used for async flushes will be implicit.

> 
> That way it might be more scale-able, you consume only 1 PCI slot
> for controller vs multiple for virtio-pmem devices.>
> 
>> Changes from previous RFC[1]:
>>
>> - Reuse existing 'pmem' code for registering persistent 
>>   memory and other operations instead of creating an entirely 
>>   new block driver.
>> - Use VIRTIO driver to register memory information with 
>>   nvdimm_bus and create region_type accordingly. 
>> - Call VIRTIO flush from existing pmem driver.
>>
>> Details of project idea for 'fake DAX' flushing interface is 
>> shared [2] & [3].
>>
>> Pankaj Gupta (2):
>>Add virtio-pmem guest driver
>>pmem: device flush over VIRTIO
>>
>> [1] https://marc.info/?l=linux-mm=150782346802290=2
>> [2] https://www.spinics.net/lists/kvm/msg149761.html
>> [3] https://www.spinics.net/lists/kvm/msg153095.html  
>>
>>  drivers/nvdimm/region_devs.c |7 ++
>>  drivers/virtio/Kconfig   |   12 +++
>>  drivers/virtio/Makefile  |1 
>>  drivers/virtio/virtio_pmem.c |  118 
>> +++
>>  include/linux/libnvdimm.h|4 +
>>  include/uapi/linux/virtio_ids.h  |1 
>>  include/uapi/linux/virtio_pmem.h |   58 +++
>>  7 files changed, 201 insertions(+)
>>
> 


-- 

Thanks,

David / dhildenb



Re: [Qemu-devel] [RFC v2 0/2] kvm "fake DAX" device flushing

2018-06-03 Thread Pankaj Gupta


Hi Igor,

> 
> [...]
> > - Qemu virtio-pmem device
> >   It exposes a persistent memory range to KVM guest which
> >   at host side is file backed memory and works as persistent
> >   memory device. In addition to this it provides virtio
> >   device handling of flushing interface. KVM guest performs
> >   Qemu side asynchronous sync using this interface.
> a random high level question,
> Have you considered using a separate (from memory itself)
> virtio device as controller for exposing some memory, async flushing.
> And then just slaving pc-dimm devices to it with notification/ACPI
> code suppressed so that guest won't touch them?

No.

> 
> That way it might be more scale-able, you consume only 1 PCI slot
> for controller vs multiple for virtio-pmem devices.

That sounds like a good suggestion. I will note it as an
enhancement once we have other concerns related to basic working 
of 'flush' interface addressed. Then probably we can work on
things 'need to optimize' with robust core flush functionality. 

BTW any sample code doing this right now in Qemu? 

> 
> 
> > Changes from previous RFC[1]:
> > 
> > - Reuse existing 'pmem' code for registering persistent
> >   memory and other operations instead of creating an entirely
> >   new block driver.
> > - Use VIRTIO driver to register memory information with
> >   nvdimm_bus and create region_type accordingly.
> > - Call VIRTIO flush from existing pmem driver.
> > 
> > Details of project idea for 'fake DAX' flushing interface is
> > shared [2] & [3].
> > 
> > Pankaj Gupta (2):
> >Add virtio-pmem guest driver
> >pmem: device flush over VIRTIO
> > 
> > [1] https://marc.info/?l=linux-mm=150782346802290=2
> > [2] https://www.spinics.net/lists/kvm/msg149761.html
> > [3] https://www.spinics.net/lists/kvm/msg153095.html
> > 
> >  drivers/nvdimm/region_devs.c |7 ++
> >  drivers/virtio/Kconfig   |   12 +++
> >  drivers/virtio/Makefile  |1
> >  drivers/virtio/virtio_pmem.c |  118
> >  +++
> >  include/linux/libnvdimm.h|4 +
> >  include/uapi/linux/virtio_ids.h  |1
> >  include/uapi/linux/virtio_pmem.h |   58 +++
> >  7 files changed, 201 insertions(+)
> > 
> 
> 
> 



Re: [Qemu-devel] [RFC v2 0/2] kvm "fake DAX" device flushing

2018-06-01 Thread Igor Mammedov
On Wed, 25 Apr 2018 16:54:12 +0530
Pankaj Gupta  wrote:

[...]
> - Qemu virtio-pmem device
>   It exposes a persistent memory range to KVM guest which 
>   at host side is file backed memory and works as persistent 
>   memory device. In addition to this it provides virtio 
>   device handling of flushing interface. KVM guest performs
>   Qemu side asynchronous sync using this interface.
a random high level question,
Have you considered using a separate (from memory itself)
virtio device as controller for exposing some memory, async flushing.
And then just slaving pc-dimm devices to it with notification/ACPI
code suppressed so that guest won't touch them?

That way it might be more scale-able, you consume only 1 PCI slot
for controller vs multiple for virtio-pmem devices.


> Changes from previous RFC[1]:
> 
> - Reuse existing 'pmem' code for registering persistent 
>   memory and other operations instead of creating an entirely 
>   new block driver.
> - Use VIRTIO driver to register memory information with 
>   nvdimm_bus and create region_type accordingly. 
> - Call VIRTIO flush from existing pmem driver.
> 
> Details of project idea for 'fake DAX' flushing interface is 
> shared [2] & [3].
> 
> Pankaj Gupta (2):
>Add virtio-pmem guest driver
>pmem: device flush over VIRTIO
> 
> [1] https://marc.info/?l=linux-mm=150782346802290=2
> [2] https://www.spinics.net/lists/kvm/msg149761.html
> [3] https://www.spinics.net/lists/kvm/msg153095.html  
> 
>  drivers/nvdimm/region_devs.c |7 ++
>  drivers/virtio/Kconfig   |   12 +++
>  drivers/virtio/Makefile  |1 
>  drivers/virtio/virtio_pmem.c |  118 
> +++
>  include/linux/libnvdimm.h|4 +
>  include/uapi/linux/virtio_ids.h  |1 
>  include/uapi/linux/virtio_pmem.h |   58 +++
>  7 files changed, 201 insertions(+)
> 




[Qemu-devel] [RFC v2 0/2] kvm "fake DAX" device flushing

2018-04-25 Thread Pankaj Gupta
This is RFC V2 for 'fake DAX' flushing interface sharing
for review. This patchset has two main parts:

- Guest virtio-pmem driver
  Guest driver reads persistent memory range from paravirt 
  device and registers with 'nvdimm_bus'. 'nvdimm/pmem' 
  driver uses this information to allocate persistent 
  memory range. Also, we have implemented guest side of 
  VIRTIO flushing interface.

- Qemu virtio-pmem device
  It exposes a persistent memory range to KVM guest which 
  at host side is file backed memory and works as persistent 
  memory device. In addition to this it provides virtio 
  device handling of flushing interface. KVM guest performs
  Qemu side asynchronous sync using this interface.

Changes from previous RFC[1]:

- Reuse existing 'pmem' code for registering persistent 
  memory and other operations instead of creating an entirely 
  new block driver.
- Use VIRTIO driver to register memory information with 
  nvdimm_bus and create region_type accordingly. 
- Call VIRTIO flush from existing pmem driver.

Details of project idea for 'fake DAX' flushing interface is 
shared [2] & [3].

Pankaj Gupta (2):
   Add virtio-pmem guest driver
   pmem: device flush over VIRTIO

[1] https://marc.info/?l=linux-mm=150782346802290=2
[2] https://www.spinics.net/lists/kvm/msg149761.html
[3] https://www.spinics.net/lists/kvm/msg153095.html  

 drivers/nvdimm/region_devs.c |7 ++
 drivers/virtio/Kconfig   |   12 +++
 drivers/virtio/Makefile  |1 
 drivers/virtio/virtio_pmem.c |  118 +++
 include/linux/libnvdimm.h|4 +
 include/uapi/linux/virtio_ids.h  |1 
 include/uapi/linux/virtio_pmem.h |   58 +++
 7 files changed, 201 insertions(+)