[PATCH 5/6] nd_blk: add support for flush hints

2015-05-28 Thread Ross Zwisler
Add support for flush hints and use them in the nd_blk I/O path instead of the global persistent_sync() whenever we can. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams dan.j.willi...@intel.com Cc: Rafael J. Wysocki r...@rjwysocki.net Cc: linux-nvd...@lists.01.org Cc

[PATCH 4/6] pmem, nd_blk: update I/O paths to use PMEM API

2015-05-28 Thread Ross Zwisler
Update the PMEM and ND_BLK I/O paths to use the new PMEM API and to adhere to the read/write flows outlined in the NVDIMM Block Window Driver Writer's Guide: http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams

[PATCH 6/6] nd_blk: add support for NVDIMM flags

2015-05-28 Thread Ross Zwisler
Add support in the ND_BLK I/O path for the latch and flush flags defined in the Get Block NVDIMM Flags _DSM function: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams dan.j.willi...@intel.com Cc: Rafael J. Wysocki

[PATCH 1/6] pmem: add force casts to avoid __iomem annotation

2015-05-28 Thread Ross Zwisler
casting the pointers received from ioremap_nocache() and given to iounmap() gives us the correct behavior and makes sparse happy. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams dan.j.willi...@intel.com Cc: linux-nvd...@lists.01.org --- drivers/block/nd/pmem.c | 7 --- 1

[PATCH 2/6] nfit: Fix up address spaces, sparse warnings

2015-05-28 Thread Ross Zwisler
for ioremapping and deinterleaving. mmio-base still has the __iomem annotation and is used via readq() and writeq() for the control and status registers. mmio-aperture is used via normal memcpy() for aperture I/O. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams dan.j.willi

[PATCH 0/6] I/O path improvements for ND_BLK and PMEM

2015-05-28 Thread Ross Zwisler
/kernel/git/djbw/nvdimm.git/log/?h=libnd-for-next One last note - I'm going to be unavailable soon, so patch feedback will most likely be handled by Dan Williams. Thanks, Dan. :) Ross Zwisler (6): pmem: add force casts to avoid __iomem annotation nfit: Fix up address spaces, sparse warnings x86

Re: [PATCH 3/6] x86, pmem: add PMEM API for persistent memory

2015-05-29 Thread Ross Zwisler
On Thu, 2015-05-28 at 16:20 -0700, H. Peter Anvin wrote: On 05/28/2015 03:35 PM, Ross Zwisler wrote: Add a new PMEM API to x86, and allow for architectures that do not implement this API. Architectures that implement the PMEM API should define ARCH_HAS_PMEM_API in their kernel

Re: [PATCH 3/6] x86, pmem: add PMEM API for persistent memory

2015-05-29 Thread Ross Zwisler
On Thu, 2015-05-28 at 21:19 -0700, H. Peter Anvin wrote: On 05/28/2015 05:02 PM, Dan Williams wrote: Hmm, yes, but I believe Ross (on vacation now) was following the precedent set by commit cd8ddf1a2800 x86: clflush_page_range needs mfence whereby the api handles all necessary fencing

Re: [PATCH 1/6] pmem: add force casts to avoid __iomem annotation

2015-05-29 Thread Ross Zwisler
On Thu, 2015-05-28 at 15:47 -0700, Dan Williams wrote: On Thu, May 28, 2015 at 3:35 PM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Even though we use ioremap_nocache() to map our persistent memory in the pmem driver, the memory we are mapping behaves like normal memory

Re: [PATCH v3 5/7] pmem: add copy_from_iter_pmem() and clear_pmem()

2015-08-17 Thread Ross Zwisler
On Mon, 2015-08-17 at 21:10 +0200, Christoph Hellwig wrote: #include linux/uaccess.h +#include linux/uio.h + Can we keep this in linux/pmem.h? I'm pretty sure the stubs would need it as well, and even if they don't it'll keep the includes consistent. Sure. +{ + size_t len; +

[PATCH v4 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-18 Thread Ross Zwisler
Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph

[PATCH v4 1/7] brd: make rd_size static

2015-08-18 Thread Ross Zwisler
Make rd_size static because it is local to drivers/block/brd.c This was reported by sparse: drivers/block/brd.c:445:5: warning: symbol 'rd_size' was not declared. Should it be static? Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph Hellwig h...@lst.de

[PATCH v4 5/7] pmem: add copy_from_iter_pmem() and clear_pmem()

2015-08-18 Thread Ross Zwisler
and are implemented in such a way that the wmb_pmem() will make the stores to PMEM durable. Because both APIs are unordered they can be called as needed without introducing any unwanted memory barriers. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/pmem.h | 75

[PATCH v4 0/7] dax: I/O path enhancements

2015-08-18 Thread Ross Zwisler
and added a TODO to move to non-temporal stores (Christoph) Ross Zwisler (7): brd: make rd_size static pmem, x86: move x86 PMEM API to new pmem.h header pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: clean up conditional pmem includes pmem: add copy_from_iter_pmem

[PATCH v4 6/7] dax: update I/O path to do proper PMEM flushing

2015-08-18 Thread Ross Zwisler
Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API. This ensures that the data DAX is writing is durable on media before the operation completes. Signed-off-by: Ross Zwisler

[PATCH v4 2/7] pmem, x86: move x86 PMEM API to new pmem.h header

2015-08-18 Thread Ross Zwisler
Move the x86 PMEM API implementation out of asm/cacheflush.h and into its own header asm/pmem.h. This will allow members of the PMEM API to be more easily identified on this and other architectures. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Suggested-by: Christoph Hellwig h

[PATCH v4 3/7] pmem: remove layer when calling arch_has_wmb_pmem()

2015-08-18 Thread Ross Zwisler
and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed

[PATCH v4 4/7] pmem, x86: clean up conditional pmem includes

2015-08-18 Thread Ross Zwisler
with the inline defaults in linux/pmem.h and gave compile errors. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph Hellwig h...@lst.de --- arch/x86/include/asm/pmem.h | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h

[PATCH v5 4/7] pmem, x86: clean up conditional pmem includes

2015-08-18 Thread Ross Zwisler
with the inline defaults in linux/pmem.h and gave compile errors. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph Hellwig h...@lst.de --- arch/x86/include/asm/pmem.h | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h

[PATCH v5 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-18 Thread Ross Zwisler
Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph

[PATCH v5 3/7] pmem: remove layer when calling arch_has_wmb_pmem()

2015-08-18 Thread Ross Zwisler
and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed

[PATCH v5 5/7] pmem: add copy_from_iter_pmem() and clear_pmem()

2015-08-18 Thread Ross Zwisler
and are implemented in such a way that the wmb_pmem() will make the stores to PMEM durable. Because both APIs are unordered they can be called as needed without introducing any unwanted memory barriers. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/pmem.h | 75

[PATCH v5 2/7] pmem, x86: move x86 PMEM API to new pmem.h header

2015-08-18 Thread Ross Zwisler
Move the x86 PMEM API implementation out of asm/cacheflush.h and into its own header asm/pmem.h. This will allow members of the PMEM API to be more easily identified on this and other architectures. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Suggested-by: Christoph Hellwig h

[PATCH v5 1/7] brd: make rd_size static

2015-08-18 Thread Ross Zwisler
Make rd_size static because it is local to drivers/block/brd.c This was reported by sparse: drivers/block/brd.c:445:5: warning: symbol 'rd_size' was not declared. Should it be static? Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed-by: Christoph Hellwig h...@lst.de

[PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-19 Thread Ross Zwisler
. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Cc: Dan Williams dan.j.willi...@intel.com --- arch/x86/Kconfig | 1 + arch/x86/include/asm/cacheflush.h | 2 ++ arch/x86/include/asm/io.h | 2 -- arch/x86/include/asm/pmem.h | 2 ++ drivers/acpi/Kconfig

Re: [PATCH] nfit, nd_blk: BLK status register is only 32 bits

2015-08-24 Thread Ross Zwisler
On Mon, Aug 24, 2015 at 01:02:17PM -0400, Jeff Moyer wrote: Ross Zwisler ross.zwis...@linux.intel.com writes: Only read 32 bits for the BLK status register in read_blk_stat(). The format and size of this register is defined in the NVDIMM Driver Writer's guide: http://pmem.io

Re: [PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-20 Thread Ross Zwisler
On Thu, 2015-08-20 at 11:26 -0700, Dan Williams wrote: On Thu, Aug 20, 2015 at 11:17 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: On Thu, 2015-08-20 at 10:59 -0700, Dan Williams wrote: [..] Ah, I think we're getting confused about the deinterleave part. The aperture is a set

Re: [PATCH] nvdimm: change to use generic kvfree()

2015-08-20 Thread Ross Zwisler
range. Reviewed-by: Ross Zwisler ross.zwis...@linux.intel.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org

Re: [PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-20 Thread Ross Zwisler
On Thu, 2015-08-20 at 10:59 -0700, Dan Williams wrote: On Thu, Aug 20, 2015 at 9:44 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: On Wed, 2015-08-19 at 16:06 -0700, Dan Williams wrote: On Wed, Aug 19, 2015 at 3:48 PM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Add support

[PATCH v5 0/7] dax: I/O path enhancements

2015-08-18 Thread Ross Zwisler
); mem_cgroup_count_vm_event(vma-vm_mm, PGMAJFAULT); result |= VM_FAULT_MAJOR; Ross Zwisler (7): brd: make rd_size static pmem, x86: move x86 PMEM API to new pmem.h header pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: clean up conditional pmem includes pmem: add

[PATCH v5 6/7] dax: update I/O path to do proper PMEM flushing

2015-08-18 Thread Ross Zwisler
Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API. This ensures that the data DAX is writing is durable on media before the operation completes. Signed-off-by: Ross Zwisler

[PATCH v3 0/7] dax: I/O path enhancements

2015-08-17 Thread Ross Zwisler
completes. Patches 1-4 are a few random cleanups. Changes from v2: - Introduce copy_from_iter_pmem() as part of the PMEM API. Keep the use of __arch_wmb_cache_pmem() internal to the implmentation of the PMEM API. (Dan) Ross Zwisler (7): brd: make rd_size static pmem, x86: move x86 PMEM API to new

[PATCH v3 1/7] brd: make rd_size static

2015-08-17 Thread Ross Zwisler
Make rd_size static because it is local to drivers/block/brd.c This was reported by sparse: drivers/block/brd.c:445:5: warning: symbol 'rd_size' was not declared. Should it be static? Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- drivers/block/brd.c | 2 +- 1 file changed, 1

[PATCH v3 4/7] pmem, x86: clean up conditional pmem includes

2015-08-17 Thread Ross Zwisler
with the inline defaults in linux/pmem.h and gave compile errors. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/pmem.h | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index 1e8dbb7

[PATCH v3 5/7] pmem: add copy_from_iter_pmem() and clear_pmem()

2015-08-17 Thread Ross Zwisler
and are implemented in such a way that the wmb_pmem() will make the stores to PMEM durable. Because both APIs are unordered they can be called as needed without introducing any unwanted memory barriers. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/pmem.h | 69

[PATCH v3 3/7] pmem: remove layer when calling arch_has_wmb_pmem()

2015-08-17 Thread Ross Zwisler
and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed

[PATCH v3 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-17 Thread Ross Zwisler
Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- Documentation

[PATCH v3 6/7] dax: update I/O path to do proper PMEM flushing

2015-08-17 Thread Ross Zwisler
Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API. This ensures that the data DAX is writing is durable on media before the operation completes. Signed-off-by: Ross Zwisler

[PATCH v3 2/7] pmem, x86: move x86 PMEM API to new pmem.h header

2015-08-17 Thread Ross Zwisler
Move the x86 PMEM API implementation out of asm/cacheflush.h and into its own header asm/pmem.h. This will allow members of the PMEM API to be more easily identified on this and other architectures. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Suggested-by: Christoph Hellwig h

Re: [PATCH v2 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-17 Thread Ross Zwisler
On Sat, 2015-08-15 at 08:44 -0700, Dan Williams wrote: On Sat, Aug 15, 2015 at 2:19 AM, Christoph Hellwig h...@lst.de wrote: On Thu, Aug 13, 2015 at 10:51:11AM -0600, Ross Zwisler wrote: Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer

Re: [PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-20 Thread Ross Zwisler
On Thu, 2015-08-20 at 13:27 -0700, Dan Williams wrote: [...] With regards to the fencing, since we already take care to flush writes we don't need to fence at all for the flush, right? All we care about is that reads see valid data. We were careful to flush writes, but we could still have

Re: [PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-20 Thread Ross Zwisler
On Wed, 2015-08-19 at 16:06 -0700, Dan Williams wrote: On Wed, Aug 19, 2015 at 3:48 PM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Add support for the read flush _DSM flag, as outlined in the DSM spec: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf This flag tells

Re: [PATCH v2] nd_blk: add support for read flush DSM flag

2015-08-20 Thread Ross Zwisler
On Thu, 2015-08-20 at 11:21 +0100, Will Deacon wrote: On Wed, Aug 19, 2015 at 11:48:04PM +0100, Ross Zwisler wrote: Add support for the read flush _DSM flag, as outlined in the DSM spec: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf This flag tells the ND BLK driver

[PATCH] nfit, nd_blk: BLK status register is only 32 bits

2015-08-20 Thread Ross Zwisler
Only read 32 bits for the BLK status register in read_blk_stat(). The format and size of this register is defined in the NVDIMM Driver Writer's guide: http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reported-by: Nicholas Moulin

Re: [PATCH v2 18/25] libnvdimm, pmem: switch from ioremap_cache to memremap

2015-07-28 Thread Ross Zwisler
On Fri, 2015-07-24 at 22:39 -0400, Dan Williams wrote: In preparation for deprecating ioremap_cache() convert its usage in libnvdimm and the PMEM API to memremap. Signed-off-by: Dan Williams dan.j.willi...@intel.com --- arch/x86/include/asm/io.h |7 +--

Re: [PATCH v2 22/25] pmem: switch from ioremap_wt to memremap

2015-07-29 Thread Ross Zwisler
On Fri, 2015-07-24 at 22:40 -0400, Dan Williams wrote: In preparation for deprecating ioremap_wt() convert its usage in the PMEM API to memremap. Cc: Ross Zwisler ross.zwis...@linux.intel.com Signed-off-by: Dan Williams dan.j.willi...@intel.com Acked-by: Ross Zwisler ross.zwis

Re: [PATCH v3 24/24] pmem: convert to generic memremap

2015-08-03 Thread Ross Zwisler
an arch has a need for different mapping types by address range. For example the ACPI NFIT carries EFI mapping types in its memory range description table. Cc: Ross Zwisler ross.zwis...@linux.intel.com Signed-off-by: Dan Williams dan.j.willi...@intel.com --- arch/x86/include/asm/io.h

Re: [PATCH v3 24/24] pmem: convert to generic memremap

2015-08-04 Thread Ross Zwisler
On Mon, 2015-08-03 at 11:01 -0700, Dan Williams wrote: On Mon, Aug 3, 2015 at 10:21 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: On Thu, 2015-07-30 at 12:55 -0400, Dan Williams wrote: Update memremap_pmem() to query the architecture for the mapping type of the given persistent

[PATCH 3/6] x86: add clwb_cache_range()

2015-08-06 Thread Ross Zwisler
in DAX to write back stores to persistent memory. Details on CLWB can be found here: https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/cacheflush.h | 1 + arch/x86/mm/pageattr.c

[PATCH 4/6] pmem: Add wb_cache_pmem() and flush_cache_pmem()

2015-08-06 Thread Ross Zwisler
, for example when punching holes of zeros in a DAX file. It can also be used as a cache invalidate when caller needs to be sure that the cache lines are completely flushed from the processor cache hierarchy. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/cacheflush.h

[PATCH 0/6] pmem, dax: I/O path enhancements

2015-08-06 Thread Ross Zwisler
types of sliding MMIO windows. At this point I'm inclined to have it as part of the PMEM API, and then take on the effort of making it a general cache flusing API if other users come along. Ross Zwisler (6): pmem: remove indirection layer arch_has_pmem_api() x86: clean up conditional pmem

[PATCH 2/6] x86: clean up conditional pmem includes

2015-08-06 Thread Ross Zwisler
-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/cacheflush.h | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h index 9bf3ea1..ae00766 100644 --- a/arch/x86/include/asm

[PATCH 1/6] pmem: remove indirection layer arch_has_pmem_api()

2015-08-06 Thread Ross Zwisler
, and just have arch_has_pmem_api() call __arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- include/linux/pmem.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/linux/pmem.h b/include/linux/pmem.h index 03f9d73..fb62ce4

[PATCH 6/6] dax: update I/O path to do proper PMEM flushing

2015-08-06 Thread Ross Zwisler
Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API. This ensures that the data DAX is writing is durable on media before the operation completes. Signed-off-by: Ross Zwisler

[PATCH 5/6] nd_blk: add support for read flush DSM flag

2015-08-06 Thread Ross Zwisler
aperture mapping from write-combining to write-back via memremap_pmem(). Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- drivers/acpi/nfit.c | 18 +- drivers/acpi/nfit.h | 6 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/nfit.c b

Re: [PATCH 1/6] pmem: remove indirection layer arch_has_pmem_api()

2015-08-07 Thread Ross Zwisler
On Thu, 2015-08-06 at 23:38 -0700, Christoph Hellwig wrote: On Thu, Aug 06, 2015 at 11:43:15AM -0600, Ross Zwisler wrote: Prior to this change arch_has_wmb_pmem() was only called by arch_has_pmem_api(). Both arch_has_wmb_pmem() and arch_has_pmem_api() checked to make sure

Re: [PATCH 1/6] pmem: remove indirection layer arch_has_pmem_api()

2015-08-07 Thread Ross Zwisler
On Fri, 2015-08-07 at 09:14 -0700, Dan Williams wrote: On Thu, Aug 6, 2015 at 10:43 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Prior to this change arch_has_wmb_pmem() was only called by arch_has_pmem_api(). Both arch_has_wmb_pmem() and arch_has_pmem_api() checked to make sure

Re: false positives with checkpatch

2015-08-07 Thread Ross Zwisler
On Fri, 2015-08-07 at 08:37 -0700, Joe Perches wrote: On Fri, 2015-08-07 at 09:01 -0600, Ross Zwisler wrote: When running checkpatch.pl against my latest patch set, I hit what I think are two false positives. Here are the related lines: +static inline void flush_cache_pmem(void

Re: [PATCH 6/6] dax: update I/O path to do proper PMEM flushing

2015-08-07 Thread Ross Zwisler
On Fri, 2015-08-07 at 07:04 +1000, Dave Chinner wrote: On Thu, Aug 06, 2015 at 11:43:20AM -0600, Ross Zwisler wrote: Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API

Re: [PATCH 0/6] pmem, dax: I/O path enhancements

2015-08-07 Thread Ross Zwisler
On Fri, 2015-08-07 at 09:47 -0700, Dan Williams wrote: On Thu, Aug 6, 2015 at 10:43 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Patch 5 adds support for the read flush _DSM flag, allowing us to change the ND BLK aperture mapping from write-combining to write-back via

Re: [PATCH 2/6] x86: clean up conditional pmem includes

2015-08-07 Thread Ross Zwisler
On Thu, 2015-08-06 at 23:39 -0700, Christoph Hellwig wrote: On Thu, Aug 06, 2015 at 11:43:16AM -0600, Ross Zwisler wrote: Prior to this change x86_64 used the pmem defines in arch/x86/include/asm/cacheflush.h, and UM used the default ones at the top of include/linux/pmem.h. The inclusion

Re: [PATCH] checkpatch: Add __pmem to $Sparse annotations

2015-08-07 Thread Ross Zwisler
of this attribute too. Signed-off-by: Joe Perches j...@perches.com Reviewed-by: Ross Zwisler ross.zwis...@linux.intel.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

[PATCH v2 0/7] dax: I/O path enhancements

2015-08-13 Thread Ross Zwisler
the arch implementation of the PMEM API into it's own arch header (Christoph). Ross Zwisler (7): brd: make rd_size static pmem, x86: move x86 PMEM API to new pmem.h header pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: clean up conditional pmem includes pmem: add

[PATCH v2 5/7] pmem: add wb_cache_pmem() and clear_pmem()

2015-08-13 Thread Ross Zwisler
, or by using non-temporal stores. Both of these new APIs must be explicitly ordered using a wmb_pmem() function call. Because both APIs are unordered they can be called as needed without introducing any unwanted memory barriers. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86

[PATCH v2 4/7] pmem, x86: clean up conditional pmem includes

2015-08-13 Thread Ross Zwisler
with the inline defaults in linux/pmem.h and gave compile errors. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/include/asm/pmem.h | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index 1e8dbb7

[PATCH v2 3/7] pmem: remove layer when calling arch_has_wmb_pmem()

2015-08-13 Thread Ross Zwisler
and the redundant CONFIG_ARCH_HAS_PMEM_API check. Rename __arch_has_wmb_pmem() to arch_has_wmb_pmem() since we no longer have a wrapper, and just have arch_has_pmem_api() call the architecture specific arch_has_wmb_pmem() directly. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Reviewed

[PATCH v2 1/7] brd: make rd_size static

2015-08-13 Thread Ross Zwisler
Make rd_size static because it is local to drivers/block/brd.c This was reported by sparse: drivers/block/brd.c:445:5: warning: symbol 'rd_size' was not declared. Should it be static? Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- drivers/block/brd.c | 2 +- 1 file changed, 1

[PATCH v2 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-13 Thread Ross Zwisler
Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver and with how this direct_access() pointer is used in the DAX code. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- Documentation

[PATCH v2 2/7] pmem, x86: move x86 PMEM API to new pmem.h header

2015-08-13 Thread Ross Zwisler
Move the x86 PMEM API implementation out of asm/cacheflush.h and into its own header asm/pmem.h. This will allow members of the PMEM API to be more easily identified on this and other architectures. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com Suggested-by: Christoph Hellwig h

[PATCH v2 6/7] dax: update I/O path to do proper PMEM flushing

2015-08-13 Thread Ross Zwisler
Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores to media using the PMEM API. This ensures that the data DAX is writing is durable on media before the operation completes. Signed-off-by: Ross Zwisler

Re: [PATCH v5 6/8] pmem: convert to generic memremap

2015-08-14 Thread Ross Zwisler
On Wed, 2015-08-12 at 20:12 -0400, Dan Williams wrote: Kill arch_memremap_pmem() and just let the architecture specify the flags to be passed to memremap(). Default to writethrough by default. Cc: Ross Zwisler ross.zwis...@linux.intel.com Suggested-by: Christoph Hellwig h...@lst.de Signed

Re: [PATCH v5 8/8] pmem: switch to devm_ allocations

2015-08-14 Thread Ross Zwisler
On Wed, 2015-08-12 at 20:12 -0400, Dan Williams wrote: From: Christoph Hellwig h...@lst.de Signed-off-by: Christoph Hellwig h...@lst.de [djbw: tools/testing/nvdimm/ and memumap_pmem support] Signed-off-by: Dan Williams dan.j.willi...@intel.com Reviewed-by: Ross Zwisler ross.zwis

Re: [PATCH v2 6/7] dax: update I/O path to do proper PMEM flushing

2015-08-14 Thread Ross Zwisler
On Thu, 2015-08-13 at 14:11 -0700, Dan Williams wrote: On Thu, Aug 13, 2015 at 9:51 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Update the DAX I/O path so that all operations that store data (I/O writes, zeroing blocks, punching holes, etc.) properly synchronize the stores

Re: [PATCH v2 7/7] pmem, dax: have direct_access use __pmem annotation

2015-08-14 Thread Ross Zwisler
On Thu, 2015-08-13 at 14:20 -0700, Dan Williams wrote: On Thu, Aug 13, 2015 at 9:51 AM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Update the annotation for the kaddr pointer returned by direct_access() so that it is a __pmem pointer. This is consistent with the PMEM driver

[PATCH] nd_blk: add support for read flush DSM flag

2015-08-14 Thread Ross Zwisler
. Signed-off-by: Ross Zwisler ross.zwis...@linux.intel.com --- arch/x86/Kconfig | 1 + arch/x86/include/asm/cacheflush.h | 2 ++ drivers/acpi/Kconfig | 1 + drivers/acpi/nfit.c | 55 ++- drivers/acpi/nfit.h

Re: [PATCH] nd_blk: add support for read flush DSM flag

2015-08-14 Thread Ross Zwisler
On Fri, 2015-08-14 at 14:05 -0700, Dan Williams wrote: On Fri, Aug 14, 2015 at 1:43 PM, Ross Zwisler ross.zwis...@linux.intel.com wrote: Add support for the read flush _DSM flag, as outlined in the DSM spec: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf This flag tells

[RFC 09/11] dax: add support for fsync/sync

2015-10-29 Thread Ross Zwisler
. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/dax.c| 161 ++-- include/linux/dax.h | 1 + mm/huge_memory.c| 14 ++--- mm/page-writeback.c | 9 +++ 4 files changed, 172 insertions(+), 13 deletions(-) diff

[RFC 03/11] pmem: enable REQ_FLUSH handling

2015-10-29 Thread Ross Zwisler
() in response to the REQ_FLUSH to ensure that before we return all the flushed data has been durably stored on the media. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drivers/nvdimm/pmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/

[RFC 08/11] fs: add get_block() to struct inode_operations

2015-10-29 Thread Ross Zwisler
() an entry in the struct inode_operations table so that we can access the correct get_block() routine in the context of the writeback infrastructure. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/ext2/file.c | 1 + fs/ext4/file.c | 1 + fs/xfs/xfs_iops.c | 1 + i

[RFC 07/11] mm: add find_get_entries_tag()

2015-10-29 Thread Ross Zwisler
) that are marked with the PAGECACHE_TAG_TOWRITE tag. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- include/linux/pagemap.h | 3 +++ mm/filemap.c| 61 + 2 files changed, 64 insertions(+) diff --git a/include/linux/pagemap.h b/i

[RFC 01/11] pmem: add wb_cache_pmem() to the PMEM API

2015-10-29 Thread Ross Zwisler
The function __arch_wb_cache_pmem() was already an internal implementation detail of the x86 PMEM API, but this functionality needs to be exported as part of the general PMEM API to handle the fsync/msync case for DAX mmaps. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- ar

[RFC 04/11] dax: support dirty DAX entries in radix tree

2015-10-29 Thread Ross Zwisler
of exceptional entry should be able to be found in a radix tree at a time depending on how it is being used. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/inode.c | 1 + include/linux/dax.h| 5 + include/linux/fs.h | 1 + include/linux

[RFC 10/11] xfs, ext2: call dax_pfn_mkwrite() on write fault

2015-10-29 Thread Ross Zwisler
Previously the functionality offered by dax_pfn_mkwrite() was open-coded in XFS and ext2. With the addition of DAX msync/fsync support we need to call dax_pfn_mkwrite() so that the newly writeable page can be added to the radix tree and marked as dirty. Signed-off-by: Ross Zwisler <ross.z

[RFC 11/11] ext4: add ext4_dax_pfn_mkwrite()

2015-10-29 Thread Ross Zwisler
Add ext4_dax_pfn_mkwrite() that properly protects against freeze, sets the file update time and calls into dax_pfn_mkwrite() to add the newly dirtied page to the radix tree which tracks dirty DAX pages. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/ext4/file.

[RFC 05/11] mm: add follow_pte_pmd()

2015-10-29 Thread Ross Zwisler
Similar to follow_pte(), follow_pte_pmd() allows either a PTE leaf or a huge page PMD leaf to be found and returned. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- include/linux/mm.h | 2 ++ mm/memory.c| 41 + 2 files chang

[RFC 06/11] mm: add pgoff_mkclean()

2015-10-29 Thread Ross Zwisler
Introduce pgoff_mkclean() which conceptually is similar to page_mkclean() except it works in the absence of struct page and it can also be used to clean PMDs. This is needed for DAX's dirty page handling. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- include/linux/rmap.

[RFC 02/11] mm: add pmd_mkclean()

2015-10-29 Thread Ross Zwisler
Currently PMD pages can be dirtied via pmd_mkdirty(), but cannot be cleaned. For DAX mmap dirty page tracking we need to be able to clean PMD pages when we flush them to media so that we get a new write fault the next time the are written to. Signed-off-by: Ross Zwisler <ross.z

[RFC 00/11] DAX fsynx/msync support

2015-10-29 Thread Ross Zwisler
l [2] http://marc.info/?l=linux-ext4=144550211312472=2 [3] https://lists.01.org/pipermail/linux-nvdimm/2015-October/002614.html Ross Zwisler (11): pmem: add wb_cache_pmem() to the PMEM API mm: add pmd_mkclean() pmem: enable REQ_FLUSH handling dax: support dirty DAX entries in radix tree

Re: [RFC 00/11] DAX fsynx/msync support

2015-10-29 Thread Ross Zwisler
On Thu, Oct 29, 2015 at 02:12:04PM -0600, Ross Zwisler wrote: > This patch series adds support for fsync/msync to DAX. > > Patches 1 through 8 add various utilities that the DAX code will eventually > need, and the DAX code itself is added by patch 9. Patches 10 and 11 are > fil

Re: [PATCH v2 1/5] pmem, dax: clean up clear_pmem()

2015-10-27 Thread Ross Zwisler
instructions for clear_page(), and arch_clear_pmem() was > always incurring the cost of __arch_wb_cache_pmem(). > > Clean up the assumption that doing clear_pmem() a page at a time is more > performant. > > Cc: Ross Zwisler <ross.zwis...@linux.intel.com> > Reported-by: Dave Hansen

Re: [PATCH 5/5] block: enable dax for raw block devices

2015-10-27 Thread Ross Zwisler
On Tue, Oct 27, 2015 at 09:19:30AM +1100, Dave Chinner wrote: > On Mon, Oct 26, 2015 at 05:56:30PM +0900, Dan Williams wrote: > > On Mon, Oct 26, 2015 at 3:23 PM, Dave Chinner wrote: > > > Also, DAX access isn't a property of mmap - it's a property > > > of the inode. We

Re: [PATCH 0/2] "big hammer" for DAX msync/fsync correctness

2015-10-28 Thread Ross Zwisler
On Wed, Oct 28, 2015 at 06:24:29PM -0400, Jeff Moyer wrote: > Ross Zwisler <ross.zwis...@linux.intel.com> writes: > > > This series implements the very slow but correct handling for > > blkdev_issue_flush() with DAX mappings, as discussed here: > > > >

[PATCH 2/2] pmem: Add simple and slow fsync/msync support

2015-10-28 Thread Ross Zwisler
this gives us correctness even if the performance is quite bad. Userspace applications looking to avoid the fsync/msync penalty should consider more fine-grained flushing via the NVML library: https://github.com/pmem/nvml Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drivers/

[PATCH 1/2] pmem: add wb_cache_pmem() to the PMEM API

2015-10-28 Thread Ross Zwisler
The function __arch_wb_cache_pmem() was already an internal implementation detail of the x86 PMEM API, but this functionality needs to be exported as part of the general PMEM API to handle the fsync/msync case for DAX mmaps. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- ar

[PATCH 0/2] "big hammer" for DAX msync/fsync correctness

2015-10-28 Thread Ross Zwisler
that the cost of blindly flushing the entire PMEM namespace on each fsync or msync will be prohibitively expensive, and that we'll by very incentivized to move to the radix tree based dirty page tracking as soon as possible. :) Ross Zwisler (2): pmem: add wb_cache_pmem() to the PMEM API pmem

Re: what's in nvdimm.git for v4.4?

2015-10-21 Thread Ross Zwisler
sposition > it for the merge window. > > === > for-4.4/dax-fixes: > === > Ross Zwisler (2): > dax: dax_pfn_mkwrite() truncate race check We can drop this patch for dax_pfn_mkwrite() as that whole function is going away after we merge the locking fixes from XFS, ext2 an

[PATCH v2 02/11] mm: add pmd_mkclean()

2015-11-13 Thread Ross Zwisler
Currently PMD pages can be dirtied via pmd_mkdirty(), but cannot be cleaned. For DAX mmap dirty page tracking we need to be able to clean PMD pages when we flush them to media so that we get a new write fault the next time the are written to. Signed-off-by: Ross Zwisler <ross.z

[PATCH v2 01/11] pmem: add wb_cache_pmem() to the PMEM API

2015-11-13 Thread Ross Zwisler
wmb_pmem(). Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- arch/x86/include/asm/pmem.h | 11 ++- include/linux/pmem.h| 22 +- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/

[PATCH v2 03/11] pmem: enable REQ_FUA/REQ_FLUSH handling

2015-11-13 Thread Ross Zwisler
to flush all dirty pages to media. The PMEM driver then just has issue a wmb_pmem() in response to the REQ_FLUSH to ensure that before we return all the flushed data has been durably stored on the media. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drivers/nvdimm/pmem

[PATCH v2 06/11] mm: add pgoff_mkclean()

2015-11-13 Thread Ross Zwisler
because it's not a requirement that each of the potentially many VMAs associated with a given struct address_space have a mapping set up for our pgoff. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- include/linux/rmap.h | 5 + mm/rmap.c

<    1   2   3   4   5   6   7   8   9   10   >