[PATCH] radix-tree: fix comment about "exceptional" bits

2016-07-19 Thread Ross Zwisler
locking */ #define RADIX_DAX_ENTRY_LOCK (1 << RADIX_TREE_EXCEPTIONAL_SHIFT) This locking code was also made specific to the DAX code instead of being generally implemented in radix-tree.h. So, fix the comment. Signed-off-by: Ross Zwisler --- include/linux/radix-tree.h | 2 +- 1 file changed, 1 inserti

Re: [PATCH v2 1/9] ext4: allow DAX writeback for hole punch

2016-09-21 Thread Ross Zwisler
On Tue, Aug 23, 2016 at 04:04:11PM -0600, Ross Zwisler wrote: > Currently when doing a DAX hole punch with ext4 we fail to do a writeback. > This is because the logic around filemap_write_and_wait_range() in > ext4_punch_hole() only looks for dirty page cache pages in the radix tree,

[PATCH v3 01/11] ext4: allow DAX writeback for hole punch

2016-09-27 Thread Ross Zwisler
Currently when doing a DAX hole punch with ext4 we fail to do a writeback. This is because the logic around filemap_write_and_wait_range() in ext4_punch_hole() only looks for dirty page cache pages in the radix tree, not for dirty DAX exceptional entries. Signed-off-by: Ross Zwisler Reviewed-by

[PATCH v3 05/11] dax: make 'wait_table' global variable static

2016-09-27 Thread Ross Zwisler
The global 'wait_table' variable is only used within fs/dax.c, and generates the following sparse warning: fs/dax.c:39:19: warning: symbol 'wait_table' was not declared. Should it be static? Make it static so it has scope local to fs/dax.c, and to make sparse happy. Signed-

[PATCH v3 09/11] dax: add struct iomap based DAX PMD support

2016-09-27 Thread Ross Zwisler
can insert the 2MiB entry. We can solve this problem if we need to, but I think that the cases where both 2MiB entries and 4K entries are being used for the same range will be rare enough and the gain small enough that it probably won't be worth the complexity. Signed-off-by: Ross Zwisle

[PATCH v3 00/11] re-enable DAX PMD support

2016-09-27 Thread Ross Zwisler
inux/kernel/git/zwisler/linux.git/log/?h=dax_pmd_v3 Ross Zwisler (11): ext4: allow DAX writeback for hole punch ext4: tell DAX the size of allocation holes dax: remove buffer_size_valid() ext2: remove support for DAX PMD faults dax: make 'wait_table' global variable static dax

[PATCH v3 11/11] dax: remove "depends on BROKEN" from FS_DAX_PMD

2016-09-27 Thread Ross Zwisler
Now that DAX PMD faults are once again working and are now participating in DAX's radix tree locking scheme, allow their config option to be enabled. Signed-off-by: Ross Zwisler --- fs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/Kconfig b/fs/Kconfig index 2bc7ad7..b6

[PATCH v3 06/11] dax: consistent variable naming for DAX entries

2016-09-27 Thread Ross Zwisler
No functional change. Consistently use the variable name 'entry' instead of 'ret' for DAX radix tree entries. This was already happening in most of the code, so update get_unlocked_mapping_entry(), grab_mapping_entry() and dax_unlock_mapping_entry(). Signed-off-by: Ross Zw

[PATCH v3 08/11] dax: remove dax_pmd_fault()

2016-09-27 Thread Ross Zwisler
dax_pmd_fault() is the old struct buffer_head + get_block_t based 2 MiB DAX fault handler. This fault handler has been disabled for several kernel releases, and support for PMDs will be reintroduced using the struct iomap interface instead. Signed-off-by: Ross Zwisler --- fs/dax.c

[PATCH v3 07/11] dax: coordinate locking for offsets in PMD range

2016-09-27 Thread Ross Zwisler
he same bit lock. To accomplish this, for ranges covered by a PMD entry we will instead lock based on the page offset of the beginning of the PMD entry. The 'mapping' pointer is still used in the same way. Signed-off-by: Ross Zwisler --- fs/dax.c| 37

[PATCH v3 10/11] xfs: use struct iomap based DAX PMD fault path

2016-09-27 Thread Ross Zwisler
Switch xfs_filemap_pmd_fault() from using dax_pmd_fault() to the new and improved iomap_dax_pmd_fault(). Also, now that it has no more users, remove xfs_get_blocks_dax_fault(). Signed-off-by: Ross Zwisler --- fs/xfs/xfs_aops.c | 25 + fs/xfs/xfs_aops.h | 3 --- fs/xfs

[PATCH v3 04/11] ext2: remove support for DAX PMD faults

2016-09-27 Thread Ross Zwisler
#x27;t reliably get PMDs, remove support so that we don't have an untested code path that we may someday traverse when we happen to get an aligned block allocation. This should also make 4k DAX faults in ext2 a bit faster since they will no longer have to call the PMD fault handler only to get a res

[PATCH v3 03/11] dax: remove buffer_size_valid()

2016-09-27 Thread Ross Zwisler
Now that ext4 properly sets bh.b_size when we call get_block() for a hole, rely on that value and remove the buffer_size_valid() sanity check. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/dax.c | 22 +- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git

[PATCH v3 02/11] ext4: tell DAX the size of allocation holes

2016-09-27 Thread Ross Zwisler
can remove buffer_size_valid() in a later patch. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/ext4/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0900cb4..9075fac 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -759,6 +759,9 @@

[PATCH] block: remove BLK_DEV_DAX config option

2016-07-29 Thread Ross Zwisler
is config option was introduced in this commit: commit 03cdadb04077 ("block: disable block device DAX by default") This change reverts that commit, removing the dead config option. Signed-off-by: Ross Zwisler Cc: Dave Hansen Cc: Dan Williams --- block/Kconfig | 13 - fs/b

[PATCH] libnvdimm, nd_blk: mask off reserved status bits

2016-07-29 Thread Ross Zwisler
erved bits need to be masked off, and the driver must avoid checking the state of those bits. This change ensures that for hardware implementations that set these reserved bits in the status register, the driver won't incorrectly fail the block I/Os. Signed-off-by: Ross Zwisler Cc: D

Re: DAX can not work on virtual nvdimm device

2016-09-08 Thread Ross Zwisler
On Tue, Sep 06, 2016 at 05:06:20PM +0200, Jan Kara wrote: > On Thu 01-09-16 20:57:38, Ross Zwisler wrote: > > On Wed, Aug 31, 2016 at 04:44:47PM +0800, Xiao Guangrong wrote: > > > On 08/31/2016 01:09 AM, Dan Williams wrote: > > > > > > > > Can you post yo

Re: DAX mapping detection (was: Re: [PATCH] Fix region lost in /proc/self/smaps)

2016-09-08 Thread Ross Zwisler
On Wed, Sep 07, 2016 at 09:32:36PM -0700, Dan Williams wrote: > [ adding linux-fsdevel and linux-nvdimm ] > > On Wed, Sep 7, 2016 at 8:36 PM, Xiao Guangrong > wrote: > [..] > > However, it is not easy to handle the case that the new VMA overlays with > > the old VMA > > already got by userspace.

Re: Panic when insmod nfit_test.ko

2016-09-13 Thread Ross Zwisler
On Tue, Sep 13, 2016 at 06:38:02AM -0700, Dan Williams wrote: > On Mon, Sep 12, 2016 at 11:01 PM, ryan chen wrote: > > On Tue, Sep 13, 2016 at 10:50 AM, Dan Williams > > wrote: > >> On Mon, Sep 12, 2016 at 7:30 PM, ryan chen wrote: > >>> Hi all, > >>> Recently I'm trying to check the testing su

Re: [PATCH v2 2/9] ext2: tell DAX the size of allocation holes

2016-09-15 Thread Ross Zwisler
On Tue, Aug 23, 2016 at 04:04:12PM -0600, Ross Zwisler wrote: > When DAX calls ext2_get_block() and the file offset points to a hole we > currently don't set bh_result->b_size. When we re-enable PMD faults DAX > will need bh_result->b_size to tell it the size of the hol

Re: DAX can not work on virtual nvdimm device

2016-08-31 Thread Ross Zwisler
On Wed, Aug 31, 2016 at 04:44:47PM +0800, Xiao Guangrong wrote: > On 08/31/2016 01:09 AM, Dan Williams wrote: > > > > Can you post your exact reproduction steps? This test is not failing for > > me. > > > > Sure. > > 1. make the guest kernel based on your tree, the top commit is >10d7902f

Re: [PATCH v2 0/9] re-enable DAX PMD support

2016-08-31 Thread Ross Zwisler
On Wed, Aug 31, 2016 at 08:20:48PM +, Kani, Toshimitsu wrote: > On Tue, 2016-08-30 at 17:01 -0600, Ross Zwisler wrote: > > On Tue, Aug 23, 2016 at 04:04:10PM -0600, Ross Zwisler wrote: > > > > > > DAX PMDs have been disabled since Jan Kara introduced DAX radix >

Re: [PATCH v2 0/9] re-enable DAX PMD support

2016-09-01 Thread Ross Zwisler
On Wed, Aug 31, 2016 at 10:08:59PM +, Kani, Toshimitsu wrote: > On Wed, 2016-08-31 at 15:36 -0600, Ross Zwisler wrote: > > On Wed, Aug 31, 2016 at 08:20:48PM +, Kani, Toshimitsu wrote: > > > > > > On Tue, 2016-08-30 at 17:01 -0600, Ross Zwisler wrote: > >

Re: DAX can not work on virtual nvdimm device

2016-09-01 Thread Ross Zwisler
On Wed, Aug 31, 2016 at 04:44:47PM +0800, Xiao Guangrong wrote: > On 08/31/2016 01:09 AM, Dan Williams wrote: > > > > Can you post your exact reproduction steps? This test is not failing for > > me. > > > > Sure. > > 1. make the guest kernel based on your tree, the top commit is >10d7902f

[PATCH 3/3] radix-tree tests: properly initialize mutex

2016-08-08 Thread Ross Zwisler
The pthread_mutex_t in regression1.c wasn't being initialized properly. Signed-off-by: Ross Zwisler --- tools/testing/radix-tree/regression1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/radix-tree/regression1.c b/tools/testing/radix-tree/regressi

[PATCH 2/3] radix-tree tests: add iteration test

2016-08-08 Thread Ross Zwisler
radix_tree_iter_next() zeros out iter->tags, so we end up exiting radix_tree_next_slot() here: if (flags & RADIX_TREE_ITER_TAGGED) { void *canon = slot; iter->tags >>= 1; if (unlikely(!iter->tags)) return NULL; Signed

[PATCH 1/3] radix-tree: 'slot' can be NULL in radix_tree_next_slot()

2016-08-08 Thread Ross Zwisler
ot'. 4) radix_tree_iter_next() via tagged iteration like radix_tree_for_each_tagged(). This happens in shmem_wait_for_pins(). radix_tree_iter_next() zeros out iter->tags, so we end up exiting radix_tree_next_slot() here: if (flags & RADIX_TREE_ITER_TAGGED) { void *canon = slot;

Re: [PATCH v2] libnvdimm, nd_blk: mask off reserved status bits

2016-08-08 Thread Ross Zwisler
On Tue, Aug 02, 2016 at 12:26:53PM -0600, Ross Zwisler wrote: > The "NVDIMM Block Window Driver Writer's Guide": > > http://pmem.io/documents/ > http://pmem.io/documents/NVDIMM_DriverWritersGuide-July-2016.pdf > > defines the layout of the block window st

[PATCH v2 8/9] dax: re-enable DAX PMD support

2016-08-23 Thread Ross Zwisler
oblem if we need to, but I think that the cases where both 2MiB entries and 4K entries are being used for the same range will be rare enough and the gain small enough that it probably won't be worth the complexity. Signed-off-by: Ross Zwisler --- fs/dax.c

[PATCH v2 9/9] dax: remove "depends on BROKEN" from FS_DAX_PMD

2016-08-23 Thread Ross Zwisler
Now that DAX PMD faults are once again working and are now participating in DAX's radix tree locking scheme, allow their config option to be enabled. Signed-off-by: Ross Zwisler --- fs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/Kconfig b/fs/Kconfig index 2bc7ad7..b6

[PATCH v2 5/9] dax: make 'wait_table' global variable static

2016-08-23 Thread Ross Zwisler
The global 'wait_table' variable is only used within fs/dax.c, and generates the following sparse warning: fs/dax.c:39:19: warning: symbol 'wait_table' was not declared. Should it be static? Make it static so it has scope local to fs/dax.c, and to make sparse happy. Signed-

[PATCH v2 0/9] re-enable DAX PMD support

2016-08-23 Thread Ross Zwisler
holes in ext2_get_block(). (Jan) - Made the 'wait_table' global variable static in respnse to a sparse warning. - Fixed some more inconsitent usage between the names 'ret' and 'entry' for radix tree entry variables. Ross Zwisler (9): ext4: allow DAX writeba

[PATCH v2 6/9] dax: consistent variable naming for DAX entries

2016-08-23 Thread Ross Zwisler
No functional change. Consistently use the variable name 'entry' instead of 'ret' for DAX radix tree entries. This was already happening in most of the code, so update get_unlocked_mapping_entry(), grab_mapping_entry() and dax_unlock_mapping_entry(). Signed-off-by: Ross Zw

[PATCH v2 2/9] ext2: tell DAX the size of allocation holes

2016-08-23 Thread Ross Zwisler
gned-off-by: Ross Zwisler --- fs/ext2/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index d5c7d09..dd55d74 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -773,6 +773,9 @@ int ext2_get_block(struct inode *inode, sector_t iblock, struct buffe

[PATCH v2 3/9] ext4: tell DAX the size of allocation holes

2016-08-23 Thread Ross Zwisler
k() has the hole size information from ext4_map_blocks(), so populate bh->b_size. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/ext4/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0900cb4..9075fac 100644 --- a/fs/ext4/inode.c

[PATCH v2 7/9] dax: coordinate locking for offsets in PMD range

2016-08-23 Thread Ross Zwisler
he same bit lock. To accomplish this, for ranges covered by a PMD entry we will instead lock based on the page offset of the beginning of the PMD entry. The 'mapping' pointer is still used in the same way. Signed-off-by: Ross Zwisler --- fs/dax.c| 37

[PATCH v2 1/9] ext4: allow DAX writeback for hole punch

2016-08-23 Thread Ross Zwisler
Currently when doing a DAX hole punch with ext4 we fail to do a writeback. This is because the logic around filemap_write_and_wait_range() in ext4_punch_hole() only looks for dirty page cache pages in the radix tree, not for dirty DAX exceptional entries. Signed-off-by: Ross Zwisler Reviewed-by

[PATCH v2 4/9] dax: remove buffer_size_valid()

2016-08-23 Thread Ross Zwisler
Now that all our supported filesystems (ext2, ext4 and XFS) all properly set bh.b_size when we call get_block() for a hole, rely on that value and remove the buffer_size_valid() sanity check. Signed-off-by: Ross Zwisler Reviewed-by: Jan Kara --- fs/dax.c | 22 +- 1 file

[PATCH] mm: silently skip readahead for DAX inodes

2016-08-24 Thread Ross Zwisler
don't do any work. Signed-off-by: Ross Zwisler Reported-by: Jeff Moyer Cc: sta...@vger.kernel.org --- mm/readahead.c | 4 1 file changed, 4 insertions(+) diff --git a/mm/readahead.c b/mm/readahead.c index 65ec288..a9ba1be 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -8,6 +

[PATCH v2] mm: silently skip readahead for DAX inodes

2016-08-24 Thread Ross Zwisler
don't do any work. Signed-off-by: Ross Zwisler Reported-by: Jeff Moyer --- Changes from v1: - Added a comment so readers don't have to go putzing around in the git tree to understand why we're doing what we're doing. :) (akpm) --- mm/readahead.c | 9 + 1 file cha

[PATCH v2 RESEND] mm: silently skip readahead for DAX inodes

2016-08-25 Thread Ross Zwisler
don't do any work. Signed-off-by: Ross Zwisler Reported-by: Jeff Moyer Cc: [4.5+] --- Changes from v1: - Added a comment so readers don't have to go putzing around in the git tree to understand why we're doing what we're doing. :) (akpm) - Resending, adding sta...@vger

Re: [PATCH v2 2/9] ext2: tell DAX the size of allocation holes

2016-08-25 Thread Ross Zwisler
On Thu, Aug 25, 2016 at 12:57:28AM -0700, Christoph Hellwig wrote: > Hi Ross, > > can you take at my (fully working, but not fully cleaned up) version > of the iomap based DAX code here: > > http://git.infradead.org/users/hch/vfs.git/shortlog/refs/heads/iomap-dax > > By using iomap we don't even

[PATCH] dax: explain how read(2)/write(2) addresses are validated

2017-08-16 Thread Ross Zwisler
arbitrary kernel addresses with this path. Signed-off-by: Ross Zwisler --- Adding a comment instead of adding redundant access_ok() calls in the DAX code. If this is the wrong path to take, please let me know. fs/dax.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/dax.c b/fs/dax.c

Re: [PATCH] dax: explain how read(2)/write(2) addresses are validated

2017-08-17 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 10:53:32AM +0200, Jan Kara wrote: > On Wed 16-08-17 11:36:15, Ross Zwisler wrote: > > Add a comment explaining how the user addresses provided to read(2) and > > write(2) are validated in the DAX I/O path. We call dax_copy_from_iter() > > or copy_to_it

Re: [RFC PATCH 2/2] mm, fs: daxfile, an interface for byte-addressable updates to pmem

2017-06-20 Thread Ross Zwisler
On Mon, Jun 19, 2017 at 10:22:14PM -0700, Darrick J. Wong wrote: <> > Fourth, the VFS entry points for things like read, write, truncate, > utimes, fallocate, etc. all just bail out if S_IOMAP_FROZEN is set on a > file, so that the block map cannot be modified. mmap is still allowed, > as we've di

[PATCH] dax: improve fix for colliding PMD & PTE entries

2017-05-26 Thread Ross Zwisler
the fault handlers and just retry. Signed-off-by: Ross Zwisler Cc: sta...@vger.kernel.org --- For both the -mm tree and for stable, feel free to squash this with the original commit if you think that is appropriate. This has passed targeted testing and an xfstests run. --- fs/dax.c | 11 +++---

Re: [HMM 07/15] mm/ZONE_DEVICE: new type of ZONE_DEVICE for unaddressable memory v3

2017-05-30 Thread Ross Zwisler
d since v1: > - rename to device private memory (from device unaddressable) > > Signed-off-by: Jérôme Glisse > Acked-by: Dan Williams > Cc: Ross Zwisler > --- <> > @@ -35,18 +37,88 @@ static inline struct vmem_altmap *to_vmem_altmap(unsigned

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 03:22:23PM -0400, Mike Snitzer wrote: > On Fri, Oct 20 2017 at 1:24am -0400, > Ross Zwisler wrote: > > > Now that we have the ability log filesystem writes using a flat buffer, add > > support for DAX. Unfortunately we can't easily track data

Re: [fstests PATCH v2] generic: add test for DAX MAP_SYNC support

2017-10-25 Thread Ross Zwisler
On Wed, Oct 25, 2017 at 03:19:22PM +0300, Amir Goldstein wrote: > On Sun, Oct 22, 2017 at 9:56 AM, Amir Goldstein wrote: > > On Sat, Oct 21, 2017 at 12:25 AM, Ross Zwisler > > wrote: > >> Add a test that exercises DAX's new MAP_SYNC flag. > >> > >>

[fstests PATCH v3] generic: add test for DAX MAP_SYNC support

2017-10-25 Thread Ross Zwisler
at we write via the mmap(), so we can't do any data integrity checking. We can only verify that the metadata writes for the page faults happened. Signed-off-by: Ross Zwisler --- Changes since v2: - Fixed _require_log_writes() so that DAX will be disallowed if the version of the dm-log-wr

[PATCH 1/2] dev/dax: fix uninitialized variable build warning

2017-10-18 Thread Ross Zwisler
ning about 'phys' being uninitialized if you broke out early in the above loop, in which case 'phys' will be set. Signed-off-by: Ross Zwisler --- drivers/dax/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/device.c b/drivers/dax/device.c

[PATCH 2/2] MAINTAINERS: Add entry for device DAX

2017-10-18 Thread Ross Zwisler
And update the entry for filesystem DAX to differentiate them. Signed-off-by: Ross Zwisler --- MAINTAINERS | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a74227a..b2b2e75 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4162,7 +4162,7

[PATCH v2] dev/dax: fix uninitialized variable build warning

2017-10-18 Thread Ross Zwisler
Fix this build warning: warning: 'phys' may be used uninitialized in this function [-Wuninitialized] As reported here: https://lkml.org/lkml/2017/10/16/152 http://kisskb.ellerman.id.au/kisskb/buildresult/13181373/log/ Signed-off-by: Ross Zwisler --- drivers/dax/device.c | 3 +

[PATCH v3 3/3] dax: temporarily disable DAX PMD fault path

2015-10-05 Thread Ross Zwisler
We are re-working the way that DAX does its locking for v4.4, so for now just disable DAX PMD faults and fall back to PAGE_SIZE faults to make sure we don't hit this deadlock. Signed-off-by: Ross Zwisler --- fs/dax.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/dax.c b/

[PATCH v3 2/3] Revert "dax: fix race between simultaneous faults"

2015-10-05 Thread Ross Zwisler
ber of deadlocks and other issues, and need to be reverted for the v4.3 kernel. The list of issues in DAX after these commits (some newly introduced by the commits, some preexisting) can be found here: https://lkml.org/lkml/2015/9/25/602 Signed-off-by: Ross Zwisler -

[PATCH v3 0/3] Revert locking changes in DAX for v4.3

2015-10-05 Thread Ross Zwisler
path while we re-work DAX locking for v4.4. Ross Zwisler (3): Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX" Revert "dax: fix race between simultaneous faults" dax: temporarily disable DAX PMD fault path fs/dax.c| 90 --

[PATCH v3 1/3] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-05 Thread Ross Zwisler
t keeps the PMEM API changes to the zeroing code in __dax_pmd_fault(), which were added by this commit: commit d77e92e270ed ("dax: update PMD fault handler with PMEM API") Signed-off-by: Ross Zwisler --- fs/dax.c| 50 ++ mm/memory.c | 11 ++

[PATCH 0/2] Add explicit coredump filtering for DAX mappings

2015-10-05 Thread Ross Zwisler
update the documentation on the new filtering flags. I'll send it out once this gets merged. [1] http://thread.gmane.org/gmane.linux.kernel.mm/139026 Ross Zwisler (2): coredump: add DAX filtering for ELF coredumps coredump: add DAX filtering for FDPIC ELF coredumps Document

[PATCH 1/2] coredump: add DAX filtering for ELF coredumps

2015-10-05 Thread Ross Zwisler
kernel config. This kernel config option defaults to "y" if both ELF binaries and coredump are enabled. Signed-off-by: Ross Zwisler --- Documentation/filesystems/proc.txt | 22 -- fs/binfmt_elf.c| 10 ++ include/linux/sched.h

[PATCH 2/2] coredump: add DAX filtering for FDPIC ELF coredumps

2015-10-05 Thread Ross Zwisler
Add explicit filtering for DAX mappings to FDPIC ELF coredump. This is useful because DAX mappings have the potential to be very large. This patch has only been compile tested. Signed-off-by: Ross Zwisler --- fs/binfmt_elf_fdpic.c | 15 +++ 1 file changed, 15 insertions(+) diff

[PATCH v4 0/2] Revert locking changes in DAX for v4.3

2015-10-06 Thread Ross Zwisler
educed the revert of 46c043ede471 in patch 1 so that we still drop the mapping->i_mmap_rwsem before calling unmap_mapping_range(). This prevents the deadlock in the __dax_pmd_fault() path so there is no longer a need to temporarily disable DAX PMD faults. Ross Zwisler (2): Revert &

[PATCH v4 2/2] Revert "dax: fix race between simultaneous faults"

2015-10-06 Thread Ross Zwisler
ber of deadlocks and other issues, and need to be reverted for the v4.3 kernel. The list of issues in DAX after these commits (some newly introduced by the commits, some preexisting) can be found here: https://lkml.org/lkml/2015/9/25/602 Signed-off-by: Ross Zwisler -

[PATCH v4 1/2] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-06 Thread Ross Zwisler
ock since that's what is now used by the rest of __dax_pmd_fault(). This is needed to avoid recursively acquiring mapping->i_mmap_rwsem, once with a read lock in __dax_pmd_fault() and once with a write lock in unmap_mapping_range(). Signed-off-by: Ross Zwisler --- fs/dax.c| 37

Re: [PATCH v4 1/2] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-07 Thread Ross Zwisler
On Wed, Oct 07, 2015 at 09:19:28AM -0700, Dan Williams wrote: > On Tue, Oct 6, 2015 at 3:28 PM, Ross Zwisler > wrote: > > diff --git a/mm/memory.c b/mm/memory.c > > index 9cb2747..5ec066f 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -2426,10

[PATCH v5] Fix DAX deadlocks for v4.3

2015-10-07 Thread Ross Zwisler
p_mapping_range() for DAX") Changes from v4: - Collapsed two revert commits into a single fix commit. No code changes were made. Ross Zwisler (1): mm, dax: fix DAX deadlocks fs/dax.c| 70 + mm/memory.c | 2 ++ 2 files

[PATCH v5] mm, dax: fix DAX deadlocks

2015-10-07 Thread Ross Zwisler
sed in v4.2. Signed-off-by: Ross Zwisler --- fs/dax.c| 70 + mm/memory.c | 2 ++ 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index bcfb14b..a86d3cc 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -28

Re: [PATCH v2 5/9] x86, pmem: push fallback handling to arch code

2015-08-28 Thread Ross Zwisler
mem() actually flushes writes to pmem must now > call arch_has_wmb_pmem() directly. > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Toshi Kani > Cc: Ross Zwisler > Cc: Christoph Hellwig > [hch: set ARCH_HAS_PMEM_API=n on X86_32] >

[PATCH] dax, pmem: add support for msync

2015-08-31 Thread Ross Zwisler
: Ross Zwisler --- This patch is based on libnvdimm-for-next from our NVDIMM tree: https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/ with some DAX patches on top. The baseline tree can be found here: https://github.com/01org/prd/tree/dax_msync --- arch/x86/include/asm/pmem.h | 13

Re: [PATCH] dax, pmem: add support for msync

2015-08-31 Thread Ross Zwisler
On Mon, Aug 31, 2015 at 09:06:19PM +0200, Christoph Hellwig wrote: > On Mon, Aug 31, 2015 at 12:59:44PM -0600, Ross Zwisler wrote: > > For DAX msync we just need to flush the given range using > > wb_cache_pmem(), which is now a public part of the PMEM API. > > > > Th

Re: [PATCH 2/2] ext2: Add locking for DAX faults

2015-10-12 Thread Ross Zwisler
on't get the full series and so are lacking in context > for proper review. ] Okay, will do. > On Fri, Oct 09, 2015 at 04:02:08PM -0600, Ross Zwisler wrote: <> > > +/* > > + * The lock ordering for ext2 DAX fault paths is: > > + * > >

Re: [PATCH 2/2] ext2: Add locking for DAX faults

2015-10-12 Thread Ross Zwisler
On Mon, Oct 12, 2015 at 10:14:43AM +1100, Dave Chinner wrote: > On Fri, Oct 09, 2015 at 04:02:08PM -0600, Ross Zwisler wrote: > > Add locking to ensure that DAX faults are isolated from ext2 operations > > that modify the data blocks allocation for an inode. This is intended to &

Re: [PATCH 2/2] ext2: Add locking for DAX faults

2015-10-13 Thread Ross Zwisler
On Tue, Oct 13, 2015 at 10:24:28AM +1100, Dave Chinner wrote: > On Mon, Oct 12, 2015 at 03:41:35PM -0600, Ross Zwisler wrote: > > On Mon, Oct 12, 2015 at 10:14:43AM +1100, Dave Chinner wrote: > > > On Fri, Oct 09, 2015 at 04:02:08PM -0600, Ross Zwisler wrote: > > > >

[PATCH] vfs: remove unused wrapper block_page_mkwrite()

2015-10-13 Thread Ross Zwisler
ent "block_page_mkwrite()", is currently unused. __block_page_mkwrite() is used directly by ext4, nilfs2 and xfs. Remove the unused wrapper and rename __block_page_mkwrite() back to block_page_mkwrite(). Signed-off-by: Ross Zwisler Cc: Jan Kara Cc: Christoph Hellwig Cc: Al Vir

Re: [PATCH 2/2] ext2: Add locking for DAX faults

2015-10-13 Thread Ross Zwisler
On Tue, Oct 13, 2015 at 10:07:12AM +0200, Jan Kara wrote: > On Mon 12-10-15 15:41:35, Ross Zwisler wrote: > > On Mon, Oct 12, 2015 at 10:14:43AM +1100, Dave Chinner wrote: > > > On Fri, Oct 09, 2015 at 04:02:08PM -0600, Ross Zwisler wrote: > > > > Add locking to ensur

Re: [PATCH 2/2] ext2: Add locking for DAX faults

2015-10-13 Thread Ross Zwisler
On Tue, Oct 13, 2015 at 12:35:44AM +0100, Eric Curtin wrote: > Hi Ross, > > For all those int ret declarations. Why not declare and initialize all > on the same line? > > Regards, > Eric Because the return value 'ret' is set unconditionally later in the function as part of a call into the DAX co

[PATCH v2 2/2] ext2: Add locking for DAX faults

2015-10-13 Thread Ross Zwisler
like hole punching, fallocate down, extent manipulation IOCTLS like xfs_ioc_space() and extent swapping. Truncate is the only one of these operations supported by ext2. Signed-off-by: Ross Zwisler --- fs/ext2/ext2.h | 11 fs/ext2/file.c

[PATCH v2 0/2] Add updated DAX locking to ext2

2015-10-13 Thread Ross Zwisler
ny (all?) the DAX fault handler wrappers that do locking for the filesystems. (Dave) - Warn if 'dax_sem' isn't properly held in __ext2_truncate_blocks. (Dan) Ross Zwisler (2): dax: dax_pfn_mkwrite() truncate race check ext2: Add locking for DAX faults fs/dax.c

[PATCH v2 1/2] dax: dax_pfn_mkwrite() truncate race check

2015-10-13 Thread Ross Zwisler
entitled "xfs: add ->pfn_mkwrite support for DAX". Signed-off-by: Ross Zwisler Cc: Dave Chinner --- fs/dax.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 131fd35a..82be6e4 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -6

[PATCH v2] vfs: remove unused wrapper block_page_mkwrite()

2015-10-13 Thread Ross Zwisler
ent "block_page_mkwrite()", is currently unused. __block_page_mkwrite() is used directly by ext4, nilfs2 and xfs. Remove the unused wrapper, rename __block_page_mkwrite() back to block_page_mkwrite() and update the comment above block_page_mkwrite(). Signed-off-by: Ross Zwisler

Re: [PATCH 0/2] Add explicit coredump filtering for DAX mappings

2015-10-13 Thread Ross Zwisler
On Mon, Oct 05, 2015 at 04:33:35PM -0600, Ross Zwisler wrote: > Add two new flags to the existing coredump mechanism for ELF files to allow > us to explicitly filter DAX mappings. This is desirable because DAX > mappings, like hugetlb mappings, have the potential to be very large.

Re: [PATCH v2 2/2] ext2: Add locking for DAX faults

2015-10-14 Thread Ross Zwisler
On Wed, Oct 14, 2015 at 10:51:19AM +0200, Jan Kara wrote: > On Tue 13-10-15 16:25:37, Ross Zwisler wrote: > > Add locking to ensure that DAX faults are isolated from ext2 operations > > that modify the data blocks allocation for an inode. This is intended to > > be analog

[PATCH] vfs: remove stale comment in inode_operations

2015-09-08 Thread Ross Zwisler
was removed as part of this commit: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay and f_inode to the underlay") The comment was left behind and now refers to nothing, so remove it. Signed-off-by: Ross Zwisler --- include/linux/fs.h | 2 -- 1 file chan

[PATCH] dax: update PMD fault handler with PMEM API

2015-09-09 Thread Ross Zwisler
by the DAX PMD patches also needs to be updated to properly use the PMEM API. This ensures that after a PMD fault is handled the zeros written to the newly allocated pages are durable on the DIMMs. linux/dax.h is included to get rid of a bunch of sparse warnings. Signed-off-by: Ross Zwisler --- Li

Re: [PATCH v2 1/2] dax: dax_pfn_mkwrite() truncate race check

2015-10-14 Thread Ross Zwisler
On Wed, Oct 14, 2015 at 04:25:50PM +1100, Dave Chinner wrote: > On Tue, Oct 13, 2015 at 04:25:36PM -0600, Ross Zwisler wrote: > > Update dax_pfn_mkwrite() so that it validates i_size before returning. > > This is necessary to ensure that the page fault has not raced with truncate

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

2015-10-21 Thread Ross Zwisler
; 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

Re: [PATCH] dax, pmem: add support for msync

2015-09-01 Thread Ross Zwisler
On Wed, Sep 02, 2015 at 08:21:20AM +1000, Dave Chinner wrote: > Which means applications that should "just work" without > modification on DAX are now subtly broken and don't actually > guarantee data is safe after a crash. That's a pretty nasty > landmine, and goes against *everything* we've claim

Re: [PATCH] dax, pmem: add support for msync

2015-09-02 Thread Ross Zwisler
On Tue, Sep 01, 2015 at 04:12:42PM +0300, Boaz Harrosh wrote: > On 08/31/2015 09:59 PM, Ross Zwisler wrote: > > @@ -753,3 +755,18 @@ int dax_truncate_page(struct inode *inode, loff_t > > from, get_block_t get_block) > > return dax_zero_page_range(inode, fr

Re: [PATCH] null_blk: fix memory leak on cleanup

2015-09-02 Thread Ross Zwisler
On Mon, Aug 31, 2015 at 02:17:18PM +0200, Matias Bjørling wrote: > From: Matias Bjørling > > Driver was not freeing the memory allocated for internal nullb queues. > This patch frees the memory during driver unload. You may want to consider devm_* style allocations instead. These are freed auto

Re: [PATCH] null_blk: fix wrong capacity when bs is not 512 bytes

2015-09-02 Thread Ross Zwisler
ize); > + set_capacity(disk, size >> 9); > > disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO; > disk->major = null_major; Looks correct. Reviewed-by: Ross Zwisler -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] dax, pmem: add support for msync

2015-09-02 Thread Ross Zwisler
On Tue, Sep 01, 2015 at 03:18:41PM +0300, Boaz Harrosh wrote: > So the approach we took was a bit different to exactly solve these > problem, and to also not over flush too much. here is what we did. > > * At vm_operations_struct we also override the .close vector (say call it > dax_vm_close) >

Re: [PATCH] dax, pmem: add support for msync

2015-09-03 Thread Ross Zwisler
On Thu, Sep 03, 2015 at 09:32:02AM +0300, Boaz Harrosh wrote: > On 09/02/2015 10:04 PM, Ross Zwisler wrote: > > On Tue, Sep 01, 2015 at 03:18:41PM +0300, Boaz Harrosh wrote: > <> > >> Apps expect all these to work: > >> 1. open mmap m-write msync ... close >

Re: fs: out of bounds on stack in iov_iter_advance

2015-10-17 Thread Ross Zwisler
On Sat, Oct 17, 2015 at 03:22:19PM -0400, Sasha Levin wrote: > On 09/30/2015 05:30 PM, Sasha Levin wrote: > > On 09/17/2015 10:24 PM, Sasha Levin wrote: > >> On 08/19/2015 01:46 AM, Al Viro wrote: > or mapping->a_ops->direct_IO() returned more > > than 'count'. > >>> Was there DAX involv

Re: [PATCH] x86: Add an explicit barrier() to clflushopt()

2015-10-19 Thread Ross Zwisler
; Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92501 > Testcase: gem_tiled_partial_pwrite_pread/read > Signed-off-by: Chris Wilson > Cc: Ross Zwisler > Cc: H. Peter Anvin > Cc: Imre Deak > Cc: Daniel Vetter > Cc: dri-de...@lists.freedesktop.org > --- > arch/x86/include/asm

Re: [PATCH 1/7] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-01 Thread Ross Zwisler
On Thu, Oct 01, 2015 at 05:46:33PM +1000, Dave Chinner wrote: > This reverts commit 46c043ede4711e8d598b9d63c5616c1fedb0605e. > --- > fs/dax.c| 36 > mm/memory.c | 11 +-- > 2 files changed, 25 insertions(+), 22 deletions(-) > > diff --git a/fs/dax

Re: [PATCH 0/7] xfs, dax: fix the page fault/allocation mess

2015-10-01 Thread Ross Zwisler
On Thu, Oct 01, 2015 at 05:46:32PM +1000, Dave Chinner wrote: > Hi folks, > > As discussed in the recent thread about problems with DAX locking: > > http://www.gossamer-threads.com/lists/linux/kernel/2264090?do=post_view_threaded > > I said that I'd post the patch set that fixed the problems for

Re: [PATCH 1/7] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-01 Thread Ross Zwisler
poral > clear_page() implementations. However, x86_64 does not use > non-temporal 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. >

Re: [PATCH 1/7] Revert "mm: take i_mmap_lock in unmap_mapping_range() for DAX"

2015-10-01 Thread Ross Zwisler
On Fri, Oct 02, 2015 at 08:32:40AM +1000, Dave Chinner wrote: > I couldn't work out what set of commits I needed to revert to get a > clean revert, so I just reverted the commits and hacked out the > revert failures to what looked ok. Feel free to send me a clean set > of reverts, and I'll replace

[PATCH 1/3] Revert "dax: fix NULL pointer in __dax_pmd_fault()"

2015-10-02 Thread Ross Zwisler
ake i_mmap_lock in unmap_mapping_range() for DAX") had other issues as well, so they need to just be reverted. The list of issues in DAX after these commits (some newly introduced by the commits, some preexisting) can be found here: https://lkml.org/lkml/2015/9/25/602 Signed-off-by: Ross Zw

[PATCH 0/3] Revert locking changes in DAX for v4.3

2015-10-02 Thread Ross Zwisler
or XFS, and Jan Kara has said he will help with ext4. akpm, this series obviates my patch "dax: fix deadlock in __dax_fault()" that is currently in the -mm tree but which I believe has not yet been sent to Linus. Can you please just remove it from -mm? Ross Zwisler (3): Re

[PATCH 3/3] Revert "dax: fix race between simultaneous faults"

2015-10-02 Thread Ross Zwisler
ber of deadlocks and other issues, and need to be reverted for the v4.3 kernel. The list of issues in DAX after these commits (some newly introduced by the commits, some preexisting) can be found here: https://lkml.org/lkml/2015/9/25/602 Signed-off-by: Ross Zwisler -

  1   2   3   4   5   6   7   8   9   10   >