Re: [fstests PATCH v6 2/2] generic: add test for DAX MAP_SYNC support

2017-12-07 Thread Eryu Guan
On Thu, Dec 07, 2017 at 04:19:50PM -0700, Ross Zwisler wrote: > This test creates a file and writes to it via an mmap(), but never syncs > via fsync/msync. This process is tracked via dm-log-writes, then replayed. > > If MAP_SYNC is working the dm-log-writes replay will show the test file > with

Re: revamp vmem_altmap / dev_pagemap handling

2017-12-07 Thread Williams, Dan J
On Thu, 2017-12-07 at 07:08 -0800, Christoph Hellwig wrote: > Hi all, > > this series started with two patches from Logan that now are in the > middle of the series to kill the memremap-internal pgmap structure > and to redo the dev_memreamp_pages interface to be better suitable > for future PCI

Re: [PATCH 10/14] memremap: change devm_memremap_pages interface to use struct dev_pagemap

2017-12-07 Thread Dan Williams
On Thu, Dec 7, 2017 at 7:08 AM, Christoph Hellwig wrote: > From: Logan Gunthorpe > > This new interface is similar to how struct device (and many others) > work. The caller initializes a 'struct dev_pagemap' as required > and calls 'devm_memremap_pages'. This

[PATCH 2/2] device-dax: implement ->pagesize() for smaps to report MMUPageSize

2017-12-07 Thread Dan Williams
Given that device-dax is making similar page mapping size guarantees as hugetlbfs, emit the size in smaps and any other kernel path that requests the mapping size of a vma. Reported-by: Jane Chu Signed-off-by: Dan Williams --- drivers/dax/device.c

[PATCH 0/2] mm, smaps: MMUPageSize for device-dax

2017-12-07 Thread Dan Williams
Andrew, Here is another occasion where we want special-case hugetlbfs enabling to also apply to device-dax. I started to wonder what other hstate conversions we might do beyond ->split() and ->pagesize(), but this appears to be the last of the usages of hstate_vma() in generic/non-hugetlbfs

[PATCH 1/2] mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct

2017-12-07 Thread Dan Williams
When device-dax is operating in huge-page mode we want it to behave like hugetlbfs and report the MMU page mapping size that is being enforced by the vma. Similar to commit 31383c6865a5 "mm, hugetlbfs: introduce ->split() to vm_operations_struct" it would be messy to teach vma_mmu_pagesize() about

[PATCH] libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment

2017-12-07 Thread Dan Williams
The following namespace configuration attempt: # ndctl create-namespace -e namespace0.0 -m devdax -a 1G -f libndctl: ndctl_dax_enable: dax0.1: failed to enable Error: namespace0.0: failed to enable failed to reconfigure namespace: No such device or address ...fails when the

Re: [fstests PATCH v5 2/2] generic: add test for DAX MAP_SYNC support

2017-12-07 Thread Ross Zwisler
On Thu, Dec 07, 2017 at 06:36:57PM +0800, Eryu Guan wrote: > Now we have two _require rules to test log_writes dm target: > _require_log_writes # _notrun explicitly when MOUNT_OPTIONS contains dax > _require_log_writes_dax # _notrun if log-writes target doesn't support > dax > > I think

Re: [PATCH 14/14] memremap: RCU protect data returned from dev_pagemap lookups

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: Take the RCU critical sections into the callers of to_vmem_altmap so that we can read the page map inside the critical section. Also rename the remaining helper to __lookup_dev_pagemap to fit into the current naming scheme. I'm not saying I

Re: [PATCH 13/14] memremap: remove struct vmem_altmap

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: There is no value in a separate vmem_altmap vs just embedding it into struct dev_pagemap, so merge the two. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe

Re: [PATCH 12/14] memremap: remove find_dev_pagemap

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: We already have the proper pfn value in both callers, so just open code the function there. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe ___

Re: [PATCH 11/14] memremap: simplify duplicate region handling in devm_memremap_pages

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: __radix_tree_insert already checks for duplicates and returns -EEXIST in that case, so remove the duplicate (and racy) duplicates check. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe

Re: [RFC PATCH v2 0/7] ndctl: nvdimmd: notify/monitor the feathers of over threshold event

2017-12-07 Thread Dan Williams
On Thu, Dec 7, 2017 at 1:58 AM, Qi, Fuli wrote: [..] >> Ok, I will make a sample hook up to Fluentd. >> >> > I tried to hook up the current json format output to Fluentd, > Fluentd parsed each line in the output as a new event. > The current json format output cannot be

Re: [PATCH 08/14] mm: merge vmem_altmap_alloc into dev_pagemap_alloc_block_buf

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: There is no clear separation between the two, so merge them. Also move the device page map argument first for the more natural calling convention. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe

Re: [PATCH 07/14] mm: split dev_pagemap memory map allocation from normal case

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: No functional changes, just untangling the call chain. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe ___ Linux-nvdimm mailing list

Re: [PATCH 06/14] mm: better abstract out dev_pagemap start_pfn

2017-12-07 Thread Logan Gunthorpe
Someone usually would yell at me if I sent a patch with no commit message ;) But the changes look good and it's pretty clear even without the message. On 07/12/17 08:08 AM, Christoph Hellwig wrote: Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe

Re: [PATCH 05/14] mm: better abstract out dev_pagemap offset calculation

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: Add a helper that looks up the altmap (or later dev_pagemap) and returns the offset. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe ___ Linux-nvdimm

Re: [PATCH 04/14] mm: better abstract out dev_pagemap alloc

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: Add a new helper that both looks up the pagemap and initializes the alloc counter. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe ___ Linux-nvdimm

Re: [PATCH 03/14] mm: better abstract out dev_pagemap freeing

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: Add a new helper that both looks up the pagemap and updates the alloc counter. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe ___ Linux-nvdimm

Re: [PATCH 02/14] mm: optimize dev_pagemap reference counting around get_dev_pagemap

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: Change the calling convention so that get_dev_pagemap always consumes the previous reference instead of doing this using an explicit earlier call to put_dev_pagemap in the callers. The callers will still need to put the final reference after

Re: [PATCH 01/14] mm: move get_dev_pagemap out of line

2017-12-07 Thread Logan Gunthorpe
On 07/12/17 08:08 AM, Christoph Hellwig wrote: This is a pretty big function, which should be out of line in general, and a no-op stub if CONFIG_ZONE_DEVICЕ is not set. Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe

[PATCH 12/14] memremap: remove find_dev_pagemap

2017-12-07 Thread Christoph Hellwig
We already have the proper pfn value in both callers, so just open code the function there. Signed-off-by: Christoph Hellwig --- kernel/memremap.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/kernel/memremap.c b/kernel/memremap.c index

[PATCH 10/14] memremap: change devm_memremap_pages interface to use struct dev_pagemap

2017-12-07 Thread Christoph Hellwig
From: Logan Gunthorpe This new interface is similar to how struct device (and many others) work. The caller initializes a 'struct dev_pagemap' as required and calls 'devm_memremap_pages'. This allows the pagemap structure to be embedded in another structure and thus

[PATCH 13/14] memremap: remove struct vmem_altmap

2017-12-07 Thread Christoph Hellwig
There is no value in a separate vmem_altmap vs just embedding it into struct dev_pagemap, so merge the two. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/init_64.c | 10 +- arch/x86/mm/init_64.c | 16 drivers/nvdimm/pfn_devs.c | 22

[PATCH 01/14] mm: move get_dev_pagemap out of line

2017-12-07 Thread Christoph Hellwig
This is a pretty big function, which should be out of line in general, and a no-op stub if CONFIG_ZONE_DEVICЕ is not set. Signed-off-by: Christoph Hellwig --- include/linux/memremap.h | 42 +- kernel/memremap.c| 36

[PATCH 04/14] mm: better abstract out dev_pagemap alloc

2017-12-07 Thread Christoph Hellwig
Add a new helper that both looks up the pagemap and initializes the alloc counter. Signed-off-by: Christoph Hellwig --- include/linux/memremap.h | 7 +++ kernel/memremap.c| 18 ++ mm/memory_hotplug.c | 23 +-- 3 files changed,

[PATCH 07/14] mm: split dev_pagemap memory map allocation from normal case

2017-12-07 Thread Christoph Hellwig
No functional changes, just untangling the call chain. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/init_64.c | 6 -- arch/x86/mm/init_64.c | 5 - include/linux/mm.h| 8 ++-- mm/sparse-vmemmap.c | 15 +++ 4 files changed, 13

[PATCH 08/14] mm: merge vmem_altmap_alloc into dev_pagemap_alloc_block_buf

2017-12-07 Thread Christoph Hellwig
There is no clear separation between the two, so merge them. Also move the device page map argument first for the more natural calling convention. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/init_64.c | 2 +- arch/x86/mm/init_64.c | 2 +- include/linux/mm.h|

[PATCH 02/14] mm: optimize dev_pagemap reference counting around get_dev_pagemap

2017-12-07 Thread Christoph Hellwig
Change the calling convention so that get_dev_pagemap always consumes the previous reference instead of doing this using an explicit earlier call to put_dev_pagemap in the callers. The callers will still need to put the final reference after finishing the loop over the pages. Signed-off-by:

[PATCH 03/14] mm: better abstract out dev_pagemap freeing

2017-12-07 Thread Christoph Hellwig
Add a new helper that both looks up the pagemap and updates the alloc counter. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/init_64.c | 6 ++ arch/x86/mm/init_64.c | 5 + include/linux/memremap.h | 7 ++- kernel/memremap.c | 9 +++-- 4 files

[PATCH 11/14] memremap: simplify duplicate region handling in devm_memremap_pages

2017-12-07 Thread Christoph Hellwig
__radix_tree_insert already checks for duplicates and returns -EEXIST in that case, so remove the duplicate (and racy) duplicates check. Signed-off-by: Christoph Hellwig --- kernel/memremap.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/kernel/memremap.c

revamp vmem_altmap / dev_pagemap handling

2017-12-07 Thread Christoph Hellwig
Hi all, this series started with two patches from Logan that now are in the middle of the series to kill the memremap-internal pgmap structure and to redo the dev_memreamp_pages interface to be better suitable for future PCI P2P uses. I reviewed them and noticed that there isn't really any good

[PATCH 14/14] memremap: RCU protect data returned from dev_pagemap lookups

2017-12-07 Thread Christoph Hellwig
Take the RCU critical sections into the callers of to_vmem_altmap so that we can read the page map inside the critical section. Also rename the remaining helper to __lookup_dev_pagemap to fit into the current naming scheme. Signed-off-by: Christoph Hellwig ---

[PATCH 06/14] mm: better abstract out dev_pagemap start_pfn

2017-12-07 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/memremap.h | 6 ++ kernel/memremap.c| 9 + mm/page_alloc.c | 4 +--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/linux/memremap.h b/include/linux/memremap.h index

[PATCH 05/14] mm: better abstract out dev_pagemap offset calculation

2017-12-07 Thread Christoph Hellwig
Add a helper that looks up the altmap (or later dev_pagemap) and returns the offset. Signed-off-by: Christoph Hellwig --- arch/powerpc/mm/mem.c| 9 +++-- arch/x86/mm/init_64.c| 6 +- include/linux/memremap.h | 8 ++-- kernel/memremap.c| 21

[PATCH 09/14] memremap: drop private struct page_map

2017-12-07 Thread Christoph Hellwig
From: Logan Gunthorpe 'struct page_map' is a private structure of 'struct dev_pagemap' but the latter replicates all the same fields as the former so there isn't much value in it. Thus drop it in favour of a completely public struct. This is a clean up in preperation for a

Re: [fstests PATCH v5 2/2] generic: add test for DAX MAP_SYNC support

2017-12-07 Thread Eryu Guan
On Tue, Dec 05, 2017 at 05:37:44PM -0700, Ross Zwisler wrote: > This test creates a file and writes to it via an mmap(), but never syncs > via fsync/msync. This process is tracked via dm-log-writes, then replayed. > > If MAP_SYNC is working the dm-log-writes replay will show the test file > with

Re: [RFC PATCH v2 0/7] ndctl: nvdimmd: notify/monitor the feathers of over threshold event

2017-12-07 Thread Qi, Fuli
On 2017/11/21 10:59, Qi, Fuli wrote: On 2017/11/21 1:13, Dan Williams wrote: On Mon, Nov 20, 2017 at 2:07 AM, Yasunori Goto wrote: On Mon, Nov 13, 2017 at 11:46 PM, QI Fuli wrote: Hi, here is my second version of nvdimm daemon, It would be

Re: [RFC PATCH v2 2/7] ndctl: nvdimmd: add nvdimmd necessary util functions

2017-12-07 Thread Qi, Fuli
+ rename(file, buf); +} Why does the monitor need to rotate logs? This should be the responsibility of whatever is consuming the nvdimmd events. When I wrote it, I thought that users can rotate nvdimmd logs without using other tools. If you think it is not necessary, I will remove it