Re: [PATCH 2/3] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-07-04 Thread zhangyi6
On 2018年07月04日 22:50, Dan Williams wrote: > On Wed, Jul 4, 2018 at 8:30 AM, Zhang Yi wrote: >> Currently, NVDIMM pages will be marked 'PageReserved'. However, unlike >> other reserved PFNs, pages on NVDIMM shall still behave like normal ones >> in many cases, i.e. when used as backend memory of

Re: [PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Zhang,Yi
On 2018年07月04日 23:25, Paolo Bonzini wrote: > On 04/07/2018 17:30, Zhang Yi wrote: >> For device specific memory space, when we move these area of pfn to >> memory zone, we will set the page reserved flag at that time, some of >> these reserved for device mmio, and some of these are not, such as

Re: [PATCH v3 2/2] ext4: handle layout changes to pinned DAX mappings

2018-07-04 Thread Darrick J. Wong
On Thu, Jul 05, 2018 at 09:54:14AM +1000, Dave Chinner wrote: > On Wed, Jul 04, 2018 at 02:27:23PM +0200, Jan Kara wrote: > > On Wed 04-07-18 10:49:23, Dave Chinner wrote: > > > On Mon, Jul 02, 2018 at 11:29:12AM -0600, Ross Zwisler wrote: > > > > Follow the lead of xfs_break_dax_layouts() and add

[PATCH v6] filesystem-dax: Introduce dax_lock_mapping_entry()

2018-07-04 Thread Dan Williams
In preparation for implementing support for memory poison (media error) handling via dax mappings, implement a lock_page() equivalent. Poison error handling requires rmap and needs guarantees that the page->mapping association is maintained / valid (inode not freed) for the duration of the lookup.

Re: [PATCH v5 07/11] filesystem-dax: Introduce dax_lock_mapping_entry()

2018-07-04 Thread kbuild test robot
Hi Dan, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3] [cannot apply to next-20180704] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day

Re: [PATCH v5 07/11] filesystem-dax: Introduce dax_lock_mapping_entry()

2018-07-04 Thread kbuild test robot
Hi Dan, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3] [cannot apply to next-20180704] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day

Re: [PATCH v3 2/2] ext4: handle layout changes to pinned DAX mappings

2018-07-04 Thread Dave Chinner
On Wed, Jul 04, 2018 at 02:27:23PM +0200, Jan Kara wrote: > On Wed 04-07-18 10:49:23, Dave Chinner wrote: > > On Mon, Jul 02, 2018 at 11:29:12AM -0600, Ross Zwisler wrote: > > > Follow the lead of xfs_break_dax_layouts() and add synchronization between > > > operations in ext4 which remove blocks

[PATCH v5 11/11] libnvdimm, pmem: Restore page attributes when clearing errors

2018-07-04 Thread Dan Williams
Use clear_mce_nospec() to restore WB mode for the kernel linear mapping of a pmem page that was marked 'HWPoison'. A page with 'HWPoison' set has also been marked UC in PAT (page attribute table) via set_mce_nospec() to prevent speculative retrievals of poison. The 'HWPoison' flag is only cleared

[PATCH v5 10/11] x86/memory_failure: Introduce {set, clear}_mce_nospec()

2018-07-04 Thread Dan Williams
Currently memory_failure() returns zero if the error was handled. On that result mce_unmap_kpfn() is called to zap the page out of the kernel linear mapping to prevent speculative fetches of potentially poisoned memory. However, in the case of dax mapped devmap pages the page may be in active

[PATCH v5 09/11] x86/mm/pat: Prepare {reserve, free}_memtype() for "decoy" addresses

2018-07-04 Thread Dan Williams
In preparation for using set_memory_uc() instead set_memory_np() for isolating poison from speculation, teach the memtype code to sanitize physical addresses vs __PHYSICAL_MASK. The motivation for using set_memory_uc() for this case is to allow ongoing access to persistent memory pages via the

[PATCH v5 08/11] mm, memory_failure: Teach memory_failure() about dev_pagemap pages

2018-07-04 Thread Dan Williams
mce: Uncorrected hardware memory error in user-access at af34214200 {1}[Hardware Error]: It has been corrected by h/w and requires no further action mce: [Hardware Error]: Machine check events logged {1}[Hardware Error]: event severity: corrected Memory failure: 0xaf34214:

[PATCH v5 02/11] device-dax: Enable page_mapping()

2018-07-04 Thread Dan Williams
In support of enabling memory_failure() handling for device-dax mappings, set the ->mapping association of pages backing device-dax mappings. The rmap implementation requires page_mapping() to return the address_space hosting the vmas that map the page. The ->mapping pointer is never cleared.

[PATCH v5 05/11] mm, madvise_inject_error: Let memory_failure() optionally take a page reference

2018-07-04 Thread Dan Williams
The madvise_inject_error() routine uses get_user_pages() to lookup the pfn and other information for injected error, but it does not release that pin. The assumption is that failed pages should be taken out of circulation. However, for dax mappings it is not possible to take pages out of

[PATCH v5 04/11] filesystem-dax: Set page->index

2018-07-04 Thread Dan Williams
In support of enabling memory_failure() handling for filesystem-dax mappings, set ->index to the pgoff of the page. The rmap implementation requires ->index to bound the search through the vma interval tree. The index is set and cleared at dax_associate_entry() and dax_disassociate_entry() time

[PATCH v5 03/11] device-dax: Set page->index

2018-07-04 Thread Dan Williams
In support of enabling memory_failure() handling for device-dax mappings, set ->index to the pgoff of the page. The rmap implementation requires ->index to bound the search through the vma interval tree. The ->index value is never cleared. There is no possibility for the page to become associated

[PATCH v5 06/11] mm, memory_failure: Collect mapping size in collect_procs()

2018-07-04 Thread Dan Williams
In preparation for supporting memory_failure() for dax mappings, teach collect_procs() to also determine the mapping size. Unlike typical mappings the dax mapping size is determined by walking page-table entries rather than using the compound-page accounting for THP pages. Cc: Naoya Horiguchi

[PATCH v5 01/11] device-dax: Convert to vmf_insert_mixed and vm_fault_t

2018-07-04 Thread Dan Williams
Use new return type vm_fault_t for fault and huge_fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Commit 1c8f422059ae ("mm: change return type to

[PATCH v5 00/11] mm: Teach memory_failure() about ZONE_DEVICE pages

2018-07-04 Thread Dan Williams
Changes since v4 [1]: * Rework dax_lock_page() to reuse get_unlocked_mapping_entry() (Jan) * Change the calling convention to take a 'struct page *' and return success / failure instead of performing the pfn_to_page() internal to the api (Jan, Ross). * Rename dax_lock_page() to

[ndctl PATCH] ndctl, test: Fix dax.sh return code

2018-07-04 Thread Dan Williams
Commit 11b349b5236e "ndctl, test: Disable poison tests for now" inadvertently prevented the dax.sh test from ever succeeding. Revert the change to return $rc instead of 0. Fixes: 11b349b5236e ("ndctl, test: Disable poison tests for now") Signed-off-by: Dan Williams --- test/dax.sh |2 +- 1

Re: [PATCH v2 0/4] Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Dan Williams
On Wed, Jul 4, 2018 at 9:55 AM, Huaisheng Ye wrote: > > > > > On Thu, 05 Jul 2018 00:48:40 +0800 Dan Williams > wrote > > On Wed, Jul 4, 2018 at 9:38 AM, Huaisheng Ye wrote: > > > From: Huaisheng Ye > > > > > > Changes since v1 [1]: > > > * Collect Jan's reviewed-by. > > > *

Re: [PATCH v6 2/4] resource: Use list_head to link sibling resource

2018-07-04 Thread kbuild test robot
Hi Baoquan, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3 next-20180704] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v6 2/4] resource: Use list_head to link sibling resource

2018-07-04 Thread kbuild test robot
Hi Baoquan, I love your patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v4.18-rc3 next-20180704] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v2 0/4] Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng Ye
On Thu, 05 Jul 2018 00:48:40 +0800 Dan Williams wrote > On Wed, Jul 4, 2018 at 9:38 AM, Huaisheng Ye wrote: > > From: Huaisheng Ye > > > > Changes since v1 [1]: > > * Collect Jan's reviewed-by. > > * According to Dan's suggestion, update the unit test infrastructure

Re: [PATCH v2 0/4] Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Dan Williams
On Wed, Jul 4, 2018 at 9:38 AM, Huaisheng Ye wrote: > From: Huaisheng Ye > > Changes since v1 [1]: > * Collect Jan's reviewed-by. > * According to Dan's suggestion, update the unit test infrastructure > tools/testing/nvdimm/pmem-dax.c for checking the validity of gfn. > > [1]:

Re: [PATCH v6 1/4] resource: Move reparent_resources() to kernel/resource.c and make it public

2018-07-04 Thread Andy Shevchenko
On Wed, Jul 4, 2018 at 7:10 AM, Baoquan He wrote: > reparent_resources() is duplicated in arch/microblaze/pci/pci-common.c > and arch/powerpc/kernel/pci-common.c, so move it to kernel/resource.c > so that it's shared. With couple of comments below, Reviewed-by: Andy Shevchenko P.S. In some

[PATCH v2 4/4] fs/dax: Assign NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara --- fs/dax.c | 9 +++-- 1 file

[PATCH v2 3/4] s390/block/dcssblk: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye direct_access needs to check the validity of pointer pfn for NULL assignment. If pfn equals to NULL, it doesn't need to calculate the value. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara --- drivers/s390/block/dcssblk.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v2 2/4] nvdimm/pmem-dax: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye direct_access needs to check the validity of pointer pfn for NULL assignment. If pfn equals to NULL, it doesn't need to calculate the value. Suggested-by: Dan Williams Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara --- tools/testing/nvdimm/pmem-dax.c | 6 -- 1 file

[PATCH v2 0/4] Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye Changes since v1 [1]: * Collect Jan's reviewed-by. * According to Dan's suggestion, update the unit test infrastructure tools/testing/nvdimm/pmem-dax.c for checking the validity of gfn. [1]: https://lkml.org/lkml/2018/7/4/81 --- Some functions within fs/dax don't need to

[PATCH v2 1/4] nvdimm/pmem: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye direct_access needs to check the validity of pointer pfn for NULL assignment. If pfn equals to NULL, it doesn't need to calculate the value. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara --- drivers/nvdimm/pmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

linux-nvdimm:目标管理与绩效考核/苏州/贵阳站--60893758

2018-07-04 Thread 急件
linux-nvdimm@lists.01.org 附、件 、内 、容 请 、您 、查 、阅 ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

RE: [External] Re: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng HS1 Ye
From: Dan Williams [mailto:dan.j.willi...@intel.com] Sent: Wednesday, July 04, 2018 10:42 PM > > On Wed, Jul 4, 2018 at 7:37 AM, Dan Williams wrote: > > On Wed, Jul 4, 2018 at 6:07 AM, Huaisheng Ye wrote: > >> On Wed, 04 Jul 2018 19:30:12 +0800 Jan Kara wrote > >> > On Wed 04-07-18

RE: [External] Re: [PATCH 1/3] nvdimm/pmem: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng HS1 Ye
> From: Dan Williams [mailto:dan.j.willi...@intel.com] > Sent: Wednesday, July 04, 2018 10:40 PM > On Tue, Jul 3, 2018 at 11:40 PM, Huaisheng Ye wrote: > > From: Huaisheng Ye > > > > Some functions within fs/dax don't need to get gfn from direct_access. > > Assigning NULL to gfn of

Re: [PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Paolo Bonzini
On 04/07/2018 16:50, Dan Williams wrote: >> + return is_zone_device_page(page) && >> + ((page->pgmap->type == MEMORY_DEVICE_FS_DAX) || >> +(page->pgmap->type == MEMORY_DEVICE_DEV_DAX)); > Jerome, might there be any use case to pass MEMORY_DEVICE_PUBLIC > memory

Re: [PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Paolo Bonzini
On 04/07/2018 17:30, Zhang Yi wrote: > For device specific memory space, when we move these area of pfn to > memory zone, we will set the page reserved flag at that time, some of > these reserved for device mmio, and some of these are not, such as > NVDIMM pmem. > > Now, we map these dev_dax or

Re: [PATCH v4 10/12] filesystem-dax: Introduce dax_lock_page()

2018-07-04 Thread Dan Williams
On Tue, Jun 12, 2018 at 11:07 AM, Ross Zwisler wrote: > On Mon, Jun 11, 2018 at 05:41:46PM +0200, Jan Kara wrote: >> On Fri 08-06-18 16:51:14, Dan Williams wrote: >> > In preparation for implementing support for memory poison (media error) >> > handling via dax mappings, implement a lock_page()

Re: [PATCH v4 10/12] filesystem-dax: Introduce dax_lock_page()

2018-07-04 Thread Dan Williams
On Tue, Jun 12, 2018 at 11:15 AM, Ross Zwisler wrote: > On Fri, Jun 08, 2018 at 04:51:14PM -0700, Dan Williams wrote: >> In preparation for implementing support for memory poison (media error) >> handling via dax mappings, implement a lock_page() equivalent. Poison >> error handling requires rmap

Re: [PATCH 2/3] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-07-04 Thread Dan Williams
On Wed, Jul 4, 2018 at 8:30 AM, Zhang Yi wrote: > Currently, NVDIMM pages will be marked 'PageReserved'. However, unlike > other reserved PFNs, pages on NVDIMM shall still behave like normal ones > in many cases, i.e. when used as backend memory of KVM guest. This patch > introduces a new memory

Re: [PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Dan Williams
[ adding Jerome ] On Wed, Jul 4, 2018 at 8:30 AM, Zhang Yi wrote: > For device specific memory space, when we move these area of pfn to > memory zone, we will set the page reserved flag at that time, some of > these reserved for device mmio, and some of these are not, such as > NVDIMM pmem. > >

Re: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Dan Williams
On Wed, Jul 4, 2018 at 7:37 AM, Dan Williams wrote: > On Wed, Jul 4, 2018 at 6:07 AM, Huaisheng Ye wrote: >> On Wed, 04 Jul 2018 19:30:12 +0800 Jan Kara wrote >> > On Wed 04-07-18 14:40:58, Huaisheng Ye wrote: >> > > From: Huaisheng Ye >> > > >> > > Some functions within fs/dax

Re: [PATCH 1/3] nvdimm/pmem: check the validity of the pointer pfn

2018-07-04 Thread Dan Williams
On Tue, Jul 3, 2018 at 11:40 PM, Huaisheng Ye wrote: > From: Huaisheng Ye > > Some functions within fs/dax don't need to get gfn from direct_access. > Assigning NULL to gfn of dax_direct_access is more intuitive and simple > than offering a useless local variable. > > So direct_access needs to

Re: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Dan Williams
On Wed, Jul 4, 2018 at 6:07 AM, Huaisheng Ye wrote: > On Wed, 04 Jul 2018 19:30:12 +0800 Jan Kara wrote > > On Wed 04-07-18 14:40:58, Huaisheng Ye wrote: > > > From: Huaisheng Ye > > > > > > Some functions within fs/dax don't need to get gfn from direct_access. > > > Assigning

Re: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng Ye
On Wed, 04 Jul 2018 19:30:12 +0800 Jan Kara wrote > On Wed 04-07-18 14:40:58, Huaisheng Ye wrote: > > From: Huaisheng Ye > > > > Some functions within fs/dax don't need to get gfn from direct_access. > > Assigning NULL to gfn of dax_direct_access is more intuitive and

Re: [PATCH v3 2/2] ext4: handle layout changes to pinned DAX mappings

2018-07-04 Thread Jan Kara
On Wed 04-07-18 10:49:23, Dave Chinner wrote: > On Mon, Jul 02, 2018 at 11:29:12AM -0600, Ross Zwisler wrote: > > Follow the lead of xfs_break_dax_layouts() and add synchronization between > > operations in ext4 which remove blocks from an inode (hole punch, truncate > > down, etc.) and pages

Re: [PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Jan Kara
On Wed 04-07-18 14:40:58, Huaisheng Ye wrote: > From: Huaisheng Ye > > Some functions within fs/dax don't need to get gfn from direct_access. > Assigning NULL to gfn of dax_direct_access is more intuitive and simple > than offering a useless local variable. > > Signed-off-by: Huaisheng Ye I

[PATCH 2/3] mm: introduce memory type MEMORY_DEVICE_DEV_DAX

2018-07-04 Thread Zhang Yi
Currently, NVDIMM pages will be marked 'PageReserved'. However, unlike other reserved PFNs, pages on NVDIMM shall still behave like normal ones in many cases, i.e. when used as backend memory of KVM guest. This patch introduces a new memory type, MEMORY_DEVICE_DEV_DAX. Together with the existing

[PATCH 3/3] kvm: add a function to check if page is from NVDIMM pmem.

2018-07-04 Thread Zhang Yi
For device specific memory space, when we move these area of pfn to memory zone, we will set the page reserved flag at that time, some of these reserved for device mmio, and some of these are not, such as NVDIMM pmem. Now, we map these dev_dax or fs_dax pages to kvm for DIMM/NVDIMM backend, since

[PATCH 1/3] kvm: remove redundant reserved page check

2018-07-04 Thread Zhang Yi
PageReserved() is already checked inside kvm_is_reserved_pfn(), remove it from kvm_set_pfn_dirty(). Signed-off-by: Zhang Yi Signed-off-by: Zhang Yu --- virt/kvm/kvm_main.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c

[PATCH 0/3] Fix kvm misconceives NVDIMM pages as reserved mmio

2018-07-04 Thread Zhang Yi
For device specific memory space, when we move these area of pfn to memory zone, we will set the page reserved flag at that time, some of these reserved for device mmio, and some of these are not, such as NVDIMM pmem. Now, we map these dev_dax or fs_dax pages to kvm for DIMM/NVDIMM backend, since

[PATCH 3/3] fs/dax: Assigning NULL to gfn of dax_direct_access if useless

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. Signed-off-by: Huaisheng Ye --- fs/dax.c | 9 +++-- 1 file changed, 3 insertions(+), 6

[PATCH 1/3] nvdimm/pmem: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. So direct_access needs to check validity of the pointer pfn For NULL assignment.

[PATCH 2/3] drivers/s390/block/dcssblk: check the validity of the pointer pfn

2018-07-04 Thread Huaisheng Ye
From: Huaisheng Ye Some functions within fs/dax don't need to get gfn from direct_access. Assigning NULL to gfn of dax_direct_access is more intuitive and simple than offering a useless local variable. So direct_access needs to check validity of the pointer pfn For NULL assignment. If pfn