Re: [PATCH 01/35] fs: introduce dmemfs module

2020-11-12 Thread yulei zhang
On Thu, Nov 12, 2020 at 7:09 AM Al Viro wrote: > > On Wed, Nov 11, 2020 at 04:53:00PM +0800, yulei zhang wrote: > > > > ... same here, seeing that you only call that thing from the next two > > > functions > > > and you do *not* provide ->mknod() as a met

Re: [PATCH 01/35] fs: introduce dmemfs module

2020-11-11 Thread yulei zhang
On Wed, Nov 11, 2020 at 4:04 AM Al Viro wrote: > > On Thu, Oct 08, 2020 at 03:53:51PM +0800, yulei.ker...@gmail.com wrote: > > > +static struct inode * > > +dmemfs_get_inode(struct super_block *sb, const struct inode *dir, umode_t > > mode, > > + dev_t dev); > > WTF is 'dev' for? >

Re: [PATCH 00/35] Enhance memory utilization with DMEMFS

2020-10-20 Thread yulei zhang
On Tue, Oct 20, 2020 at 3:03 AM Joao Martins wrote: > > On 10/19/20 2:37 PM, Paolo Bonzini wrote: > > On 15/10/20 00:25, Dan Williams wrote: > >> Now, with recent device-dax extensions, it > >> also has a coarse grained memory management system for physical > >> address-space partitioning and a

Re: [PATCH 04/35] dmem: let pat recognize dmem

2020-10-13 Thread yulei zhang
On Tue, Oct 13, 2020 at 3:27 PM Paolo Bonzini wrote: > > On 08/10/20 09:53, yulei.ker...@gmail.com wrote: > > From: Yulei Zhang > > > > x86 pat uses 'struct page' by only checking if it's system ram, > > however it is not true if dmem is used, let's teach

Re: [PATCH 00/35] Enhance memory utilization with DMEMFS

2020-10-12 Thread yulei zhang
> v...@zeniv.linux.org.uk; pbonz...@redhat.com > > Cc: linux-fsde...@vger.kernel.org; k...@vger.kernel.org; > > linux-kernel@vger.kernel.org; xiaoguangrong.e...@gmail.com; > > kernel...@gmail.com; lihaiwei.ker...@gmail.com; Yulei Zhang > > Subject: [PATCH 00/35] Enha

Re: [PATCH 00/35] Enhance memory utilization with DMEMFS

2020-10-10 Thread yulei zhang
On Fri, Oct 9, 2020 at 7:53 PM Joao Martins wrote: > > On 10/9/20 12:39 PM, yulei zhang wrote: > > Joao, thanks a lot for the feedback. One more thing needs to mention > > is that dmemfs also support fine-grained > > memory management which makes it more flexible for te

Re: [PATCH 08/35] dmem: show some statistic in debugfs

2020-10-09 Thread yulei zhang
Thanks, Randy. I will follow the instructions to modify the patches. On Fri, Oct 9, 2020 at 4:23 AM Randy Dunlap wrote: > > On 10/8/20 12:53 AM, yulei.ker...@gmail.com wrote: > > diff --git a/mm/Kconfig b/mm/Kconfig > > index e1995da11cea..8a67c8933a42 100644 > > --- a/mm/Kconfig > > +++

Re: [PATCH 22/35] kvm, x86: Distinguish dmemfs page from mmio page

2020-10-09 Thread yulei zhang
Sean and Joao, thanks for the feedback. Probably we can drop this change. On Fri, Oct 9, 2020 at 6:28 PM Joao Martins wrote: > > On 10/9/20 1:58 AM, Sean Christopherson wrote: > > On Thu, Oct 08, 2020 at 03:54:12PM +0800, yulei.ker...@gmail.com wrote: > >> From: Yulei Zhang

Re: [PATCH 00/35] Enhance memory utilization with DMEMFS

2020-10-09 Thread yulei zhang
rectly or indirectly work on the subject] > > On 10/8/20 8:53 AM, yulei.ker...@gmail.com wrote: > > From: Yulei Zhang > > > > In current system each physical memory page is assocaited with > > a page structure which is used to track the usage of this page. > > B

Re: [RFC V2 0/9] x86/mmu:Introduce parallel memory virtualization to boost performance

2020-09-28 Thread yulei zhang
On Sat, Sep 26, 2020 at 4:50 AM Paolo Bonzini wrote: > > On 25/09/20 19:30, Ben Gardon wrote: > > Oh, thank you for explaining that. I didn't realize the goal here was > > to improve LM performance. I was under the impression that this was to > > give VMs a better experience on startup for fast

Re: [RFC V2 0/9] x86/mmu:Introduce parallel memory virtualization to boost performance

2020-09-25 Thread yulei zhang
s? guys! > > > On Tue, 1 Sep 2020 at 19:52, wrote: > > > > > > > > From: Yulei Zhang > > > > > > > > Currently in KVM memory virtulization we relay on mmu_lock to > > > > synchronize the memory mapping update, which make vCPUs work

Re: [RFC 0/9] KVM:x86/mmu:Introduce parallel memory virtualization to boost performance

2020-08-07 Thread yulei zhang
On Fri, Aug 7, 2020 at 1:04 AM Ben Gardon wrote: > > On Wed, Aug 5, 2020 at 9:53 AM Yulei Zhang wrote: > > > > From: Yulei Zhang > > > > Currently in KVM memory virtulization we relay on mmu_lock to synchronize > > the memory mapping update, which make vCPUs

[RFC 8/9] Introduce kvm module parameter global_tdp to turn on the direct build EPT mode

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Currently global_tdp is only supported on intel X86 system with ept supported, and it will turn off the smm mode when enable global_tdp. Signed-off-by: Yulei Zhang --- arch/x86/include/asm/kvm_host.h | 4 arch/x86/kvm/mmu/mmu.c | 5 - arch/x86/kvm/x86.c

[RFC 5/9] Modify the page fault path to meet the direct build EPT requirement

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Refine the fast page fault code so that it can be used in either normal ept mode or direct build EPT mode. Signed-off-by: Yulei Zhang --- arch/x86/kvm/mmu/mmu.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm

[RFC 6/9] Apply the direct build EPT according to the memory slots change

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Construct the direct build ept when guest memory slots have been changed, and issue mmu_reload request to update the CR3 so that guest could use the pre-constructed EPT without page fault. Signed-off-by: Yulei Zhang --- arch/mips/kvm/mips.c | 13 + arch

[RFC 7/9] Add migration support when using direct build EPT

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Make migration available in direct build ept mode whether pml enabled or not. Signed-off-by: Yulei Zhang --- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/mmu/mmu.c | 153 +++- arch/x86/kvm/x86.c | 44 + 3

[RFC 4/9] Add release function for direct build ept when guest VM exit

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Release the pre-pinned memory in direct build ept when guest VM exit. Signed-off-by: Yulei Zhang --- arch/x86/kvm/mmu/mmu.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu

[RFC 9/9] Handle certain mmu exposed functions properly while turn on direct build EPT mode

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Signed-off-by: Yulei Zhang --- arch/x86/kvm/mmu/mmu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index f963a3b0500f..bad01f66983d 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -1775,6

[RFC 2/9] Introduce page table population function for direct build EPT feature

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Page table population function will pin the memory and pre-construct the EPT base on the input memory slot configuration so that it won't relay on the page fault interrupt to setup the page table. Signed-off-by: Yulei Zhang --- arch/x86/include/asm/kvm_host.h | 2 +- arch

[RFC 3/9] Introduce page table remove function for direct build EPT feature

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang During guest boots up it will modify the memory slots multiple times, so add page table remove function to free pre-pinned memory according to the the memory slot changes. Signed-off-by: Yulei Zhang --- arch/x86/kvm/mmu/mmu.c | 56

[RFC 0/9] KVM:x86/mmu:Introduce parallel memory virtualization to boost performance

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Currently in KVM memory virtulization we relay on mmu_lock to synchronize the memory mapping update, which make vCPUs work in serialize mode and slow down the execution, especially after migration to do substantial memory mapping setup, and performance get worse if increase

[RFC 1/9] Introduce new fields in kvm_arch/vcpu_arch struct for direct build EPT support

2020-08-05 Thread Yulei Zhang
From: Yulei Zhang Add parameter global_root_hpa for saving direct build global EPT root point, and add per-vcpu flag direct_build_tdp to indicate using global EPT root point. Signed-off-by: Yulei Zhang --- arch/x86/include/asm/kvm_host.h | 5 + 1 file changed, 5 insertions(+) diff --git

[RFC PATCH] vfio: Implement new Ioctl VFIO_IOMMU_GET_DIRTY_BITMAP

2018-04-10 Thread Yulei Zhang
status restore. Signed-off-by: Yulei Zhang <yulei.zh...@intel.com> --- drivers/vfio/vfio_iommu_type1.c | 42 + include/uapi/linux/vfio.h | 14 ++ 2 files changed, 56 insertions(+) diff --git a/drivers/vfio/vfio_iommu_type1.c b/driver

[RFC PATCH] vfio: Implement new Ioctl VFIO_IOMMU_GET_DIRTY_BITMAP

2018-04-10 Thread Yulei Zhang
status restore. Signed-off-by: Yulei Zhang --- drivers/vfio/vfio_iommu_type1.c | 42 + include/uapi/linux/vfio.h | 14 ++ 2 files changed, 56 insertions(+) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c

[PATCH RFC] vfio: Implement new Ioctl VFIO_IOMMU_GET_DIRTY_BITMAP

2017-07-31 Thread Yulei Zhang
This patch is to implement the new ioctl VFIO_IOMMU_GET_DIRTY_BITMAP to fulfill the requirement for vfio-mdev device live migration, which need copy the memory that has been pinned in iommu container to the target VM for mdev device status restore. Signed-off-by: Yulei Zhang <yulei

[PATCH RFC] vfio: Implement new Ioctl VFIO_IOMMU_GET_DIRTY_BITMAP

2017-07-31 Thread Yulei Zhang
This patch is to implement the new ioctl VFIO_IOMMU_GET_DIRTY_BITMAP to fulfill the requirement for vfio-mdev device live migration, which need copy the memory that has been pinned in iommu container to the target VM for mdev device status restore. Signed-off-by: Yulei Zhang --- drivers/vfio