Re: [RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-04-04 Thread Balbir Singh
On Thu, 5 Apr 2018 15:04:05 +1000 Nicholas Piggin wrote: > On Wed, 4 Apr 2018 20:00:52 -0700 > Dan Williams wrote: > > > [ adding Matthew, Christoph, and Tony ] > > > > On Wed, Apr 4, 2018 at 4:57 PM, Nicholas Piggin wrote: >

[ndctl PATCH] ndctl, rescan-partitions.sh: fix skipping for missing modules

2018-04-04 Thread Vishal Verma
rescan-partitions would fail if the nfit_test module was not found. Fix by moving the modprobe attempt to earlier in the test. Cc: Dan Williams Signed-off-by: Vishal Verma --- test/rescan-partitions.sh | 2 +- 1 file changed, 1 insertion(+),

Re: [RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-04-04 Thread Dan Williams
[ adding Matthew, Christoph, and Tony ] On Wed, Apr 4, 2018 at 4:57 PM, Nicholas Piggin wrote: > On Thu, 5 Apr 2018 09:19:42 +1000 > Balbir Singh wrote: > >> The pmem infrastructure uses memcpy_mcsafe in the pmem >> layer so as to convert machine

Re: [RESEND 1/3] powerpc/mce: Bug fixes for MCE handling in kernel space

2018-04-04 Thread Balbir Singh
On Thu, 5 Apr 2018 09:49:00 +1000 Nicholas Piggin wrote: > On Thu, 5 Apr 2018 09:19:41 +1000 > Balbir Singh wrote: > > > The code currently assumes PAGE_SHIFT as the shift value of > > the pfn, this works correctly (mostly) for user space pages, > >

Re: Can't hit dax pmd fault on nvdimm in raw mode

2018-04-04 Thread Xiong Zhou
On Wed, Apr 04, 2018 at 07:48:23AM -0700, Dan Williams wrote: > On Wed, Apr 4, 2018 at 7:37 AM, Xiong Zhou wrote: > > Hi, > > > > It works fine in memory mode. Both tested on latest Linus tree with xfs. > > > > Referring https://nvdimm.wiki.kernel.org/2mib_fs_dax > > > > Did I

Re: [PATCH] dax: adding fsync/msync support for device DAX

2018-04-04 Thread Dan Williams
Include lkml on the next posting as well. On Wed, Apr 4, 2018 at 3:01 PM, Dave Jiang wrote: > When msync() is called on a device dax region, eventually ops->fsync() is > called. By providing fsync in the device dax file operations, we can provide > support for both.

Re: [RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-04-04 Thread Nicholas Piggin
On Thu, 5 Apr 2018 09:19:42 +1000 Balbir Singh wrote: > The pmem infrastructure uses memcpy_mcsafe in the pmem > layer so as to convert machine check excpetions into > a return value on failure in case a machine check > exception is encoutered during the memcpy. > > This

Re: [RESEND 1/3] powerpc/mce: Bug fixes for MCE handling in kernel space

2018-04-04 Thread Nicholas Piggin
On Thu, 5 Apr 2018 09:19:41 +1000 Balbir Singh wrote: > The code currently assumes PAGE_SHIFT as the shift value of > the pfn, this works correctly (mostly) for user space pages, > but the correct thing to do is It would be good to actually explain the problem in the

[RESEND 3/3] powerpc/mce: Handle memcpy_mcsafe

2018-04-04 Thread Balbir Singh
Add a blocking notifier callback to be called in real-mode on machine check exceptions for UE (ld/st) errors only. The patch registers a callback on boot to be notified of machine check exceptions and returns a NOTIFY_STOP when a page of interest is seen as the source of the machine check

[RESEND 2/3] powerpc/memcpy: Add memcpy_mcsafe for pmem

2018-04-04 Thread Balbir Singh
The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check excpetions into a return value on failure in case a machine check exception is encoutered during the memcpy. This patch largely borrows from the copyuser_power7 logic and does not add the VMX

[RESEND 0/3] Add support for memcpy_mcsafe

2018-04-04 Thread Balbir Singh
memcpy_mcsafe() is an API currently used by the pmem subsystem to convert errors while doing a memcpy (machine check exception errors) to a return value. This patchset consists of three patches 1. The first patch is a bug fix to handle machine check errors correctly while walking the page tables

[ndctl PATCH] ndctl: export ndctl.h

2018-04-04 Thread Dan Williams
The ndctl project maintains a local version of the ndctl.h header file published by the kernel. Given that the kernel header may be out of date relative to the header used to build ndctl, provide the local version in ndctl/ndctl.h alongside ndctl/libndctl.h so that consumers of the library have

[PATCH] dax: adding fsync/msync support for device DAX

2018-04-04 Thread Dave Jiang
When msync() is called on a device dax region, eventually ops->fsync() is called. By providing fsync in the device dax file operations, we can provide support for both. nvdimm_flush() for the nd_region is called when msync/fsync is called in order to provide deep flush to the user app through

Re: [v8, 11/18] mm, dax: enable filesystems to trigger dev_pagemap ->page_free callbacks

2018-04-04 Thread Andrei Vagin
On Wed, Apr 04, 2018 at 02:23:40PM -0700, Andrei Vagin wrote: > Hi Dan, > > I catch the following bug on the linux-next 20180404. git bisect brought me > to this commit: The next patch fixes the problem: diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 5b13da127982..

Re: [v8, 11/18] mm, dax: enable filesystems to trigger dev_pagemap ->page_free callbacks

2018-04-04 Thread Dan Williams
[ adding Stephen ] On Wed, Apr 4, 2018 at 2:27 PM, Dan Williams <dan.j.willi...@intel.com> wrote: > On Wed, Apr 4, 2018 at 2:23 PM, Andrei Vagin <ava...@virtuozzo.com> wrote: >> Hi Dan, >> >> I catch the following bug on the linux-next 20180404. git bisect broug

Re: [v8, 11/18] mm, dax: enable filesystems to trigger dev_pagemap ->page_free callbacks

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 2:23 PM, Andrei Vagin <ava...@virtuozzo.com> wrote: > Hi Dan, > > I catch the following bug on the linux-next 20180404. git bisect brought me > to this commit: Yes, I will be yanking this functionality out of -next shortly and t

Re: [v8, 11/18] mm, dax: enable filesystems to trigger dev_pagemap ->page_free callbacks

2018-04-04 Thread Andrei Vagin
Hi Dan, I catch the following bug on the linux-next 20180404. git bisect brought me to this commit: commit 8e4d1ccc5286d2c3da6515b92323a3529aa64496 (HEAD, refs/bisect/bad) Author: Dan Williams <dan.j.willi...@intel.com> Date: Sat Oct 21 14:41:13 2017 -0700 mm, dax: enable files

[ndctl PATCH 5/5] ndctl, scrub: add {wait, start}-scrub helper utilities

2018-04-04 Thread Dan Williams
Provide utilities to make it easy for a platform owner to poll for the completion of ARS scrubbing, or otherwise launch an ARS run across 1 or more nvdimm buses. These commands take 1 or more bus identifiers (bus device name, bus number, or bus provider name), and runs a 'start' or 'wait' ARS

[ndctl PATCH 0/5] Address Range Scrub (ARS) Utilities

2018-04-04 Thread Dan Williams
Add ndctl utility support for listing the state of ARS operations, waiting for an existing ARS run to complete, and initiating new ARS runs. A few fixes and new apis fall out as a result. --- Dan Williams (5): ndctl, scrub: fix ndctl_bus_wait_for_scrub_completion() ndctl, scrub:

[ndctl PATCH 1/5] ndctl, scrub: fix ndctl_bus_wait_for_scrub_completion()

2018-04-04 Thread Dan Williams
Given that we trust the kernel to increment the scrub count when transitioning from in-progress to idle it is safe to wait forever. Previously this routine was mistakenly waiting 120ms when it thought it was waiting 120 seconds, was not verifying the in-progress was cleared after a wakeup, and was

[ndctl PATCH 4/5] ndctl: add new START and WAIT actions

2018-04-04 Thread Dan Williams
In preparation for adding 'start-scrub' and 'wait-scrub' utilities, define new device actions for these operations. Signed-off-by: Dan Williams --- ndctl/action.h|2 ++ ndctl/namespace.c |3 +++ 2 files changed, 5 insertions(+) diff --git a/ndctl/action.h

[ndctl PATCH 3/5] ndctl, scrub: add ndctl_bus_start_scrub()

2018-04-04 Thread Dan Williams
Provide a helper routine to kick off a new ARS scrub if one is not already running, or otherwise detect if ARS functionality is available. Signed-off-by: Dan Williams --- ndctl/lib/libndctl.c | 13 + ndctl/lib/libndctl.sym |1 + ndctl/libndctl.h

[ndctl PATCH 2/5] ndctl, scrub: report the bus scrub state in 'ndctl list'

2018-04-04 Thread Dan Williams
In preparation for adding 'wait-scrub' and 'start-scrub' utility helpers, indicate the current state of ARS operations in the listing for bus objects. The field is omitted if the bus does not support ARS operations. Signed-off-by: Dan Williams --- ndctl/lib/libndctl.c

Re: [PATCH 5/6] nfit, address-range-scrub: rework and simplify ARS state machine

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 9:26 AM, Kani, Toshi wrote: > On Mon, 2018-04-02 at 21:46 -0700, Dan Williams wrote: > : >> +static int init_ars(struct acpi_nfit_desc *acpi_desc, struct nfit_spa >> *nfit_spa, >> +int query_rc) >> { >> -struct acpi_nfit_system_address *spa =

Re: [PATCH 5/6] nfit, address-range-scrub: rework and simplify ARS state machine

2018-04-04 Thread Kani, Toshi
On Mon, 2018-04-02 at 21:46 -0700, Dan Williams wrote: : > +static int init_ars(struct acpi_nfit_desc *acpi_desc, struct nfit_spa > *nfit_spa, > + int query_rc) > { > - struct acpi_nfit_system_address *spa = nfit_spa->spa; > - unsigned int overflow_retry =

Re: Can't hit dax pmd fault on nvdimm in raw mode

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 7:37 AM, Xiong Zhou wrote: > Hi, > > It works fine in memory mode. Both tested on latest Linus tree with xfs. > > Referring https://nvdimm.wiki.kernel.org/2mib_fs_dax > > Did I miss anything? No, this behavior is by design. See commit ee82c9ed41e8 "dax:

Re: [RFC PATCH v4] ndctl: monitor: add ndctl monitor daemon

2018-04-04 Thread Jeff Moyer
"Qi, Fuli" writes: >> > In this implemention, when a ndctl monitor starts with [--daemon] option, >> > all >> > the arguments will be saved into a temp file named as daemon-name and >> > placed >> > under /etc/sysconfig/ndctl/ directory. The temp file would be used as

Re: [RESEND v2 3/4] doc/devicetree: Persistent memory region bindings

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 7:04 AM, Oliver wrote: > On Wed, Apr 4, 2018 at 10:07 PM, Balbir Singh wrote: >> On Tue, 3 Apr 2018 10:37:51 -0700 >> Dan Williams wrote: >> >>> On Tue, Apr 3, 2018 at 7:24 AM, Oliver O'Halloran

Re: [PATCH v8 15/18] mm, fs, dax: handle layout changes to pinned dax mappings

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 2:46 AM, Jan Kara wrote: > On Fri 30-03-18 21:03:30, Dan Williams wrote: >> Background: >> >> get_user_pages() in the filesystem pins file backed memory pages for >> access by devices performing dma. However, it only pins the memory pages >> not the

Re: [RESEND v2 3/4] doc/devicetree: Persistent memory region bindings

2018-04-04 Thread Oliver
On Wed, Apr 4, 2018 at 10:07 PM, Balbir Singh wrote: > On Tue, 3 Apr 2018 10:37:51 -0700 > Dan Williams wrote: > >> On Tue, Apr 3, 2018 at 7:24 AM, Oliver O'Halloran wrote: >> > Add device-tree binding documentation for the

Re: [RESEND v2 4/4] powerpc/powernv: Create platform devs for nvdimm buses

2018-04-04 Thread Balbir Singh
On Wed, 4 Apr 2018 00:24:15 +1000 Oliver O'Halloran wrote: > Scan the devicetree for an nvdimm-bus compatible and create > a platform device for them. > > Signed-off-by: Oliver O'Halloran > --- Acked-by: Balbir Singh

Re: [RESEND v2 1/4] libnvdimm: Add of_node to region and bus descriptors

2018-04-04 Thread Balbir Singh
On Wed, 4 Apr 2018 00:24:12 +1000 Oliver O'Halloran wrote: > We want to be able to cross reference the region and bus devices > with the device tree node that they were spawned from. libNVDIMM > handles creating the actual devices for these internally, so we > need to pass in

Re: [PATCH v8 15/18] mm, fs, dax: handle layout changes to pinned dax mappings

2018-04-04 Thread Jan Kara
On Wed 04-04-18 11:46:56, Jan Kara wrote: > On Fri 30-03-18 21:03:30, Dan Williams wrote: > > Background: > > > > get_user_pages() in the filesystem pins file backed memory pages for > > access by devices performing dma. However, it only pins the memory pages > > not the page-to-file offset

Re: [PATCH v8 15/18] mm, fs, dax: handle layout changes to pinned dax mappings

2018-04-04 Thread Jan Kara
On Fri 30-03-18 21:03:30, Dan Williams wrote: > Background: > > get_user_pages() in the filesystem pins file backed memory pages for > access by devices performing dma. However, it only pins the memory pages > not the page-to-file offset association. If a file is truncated the > pages are mapped