Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1493766 > unrolled thread
| Started by | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| First post | 2016-09-30 00:50 +0200 |
| Last post | 2016-09-30 13:50 +0200 |
| Articles | 20 on this page of 42 — 6 participants |
Back to article view | Back to linux.kernel
[PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 00:50 +0200
[PATCH v4 06/12] dax: consistent variable naming for DAX entries Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 06/12] dax: consistent variable naming for DAX entries Jan Kara <jack@suse.cz> - 2016-10-03 11:40 +0200
[PATCH v4 02/12] ext4: tell DAX the size of allocation holes Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
[PATCH v4 05/12] dax: make 'wait_table' global variable static Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 05/12] dax: make 'wait_table' global variable static Jan Kara <jack@suse.cz> - 2016-10-03 11:40 +0200
[PATCH v4 12/12] dax: remove "depends on BROKEN" from FS_DAX_PMD Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
[PATCH v4 09/12] dax: correct dax iomap code namespace Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 09/12] dax: correct dax iomap code namespace Christoph Hellwig <hch@lst.de> - 2016-09-30 11:00 +0200
Re: [PATCH v4 09/12] dax: correct dax iomap code namespace Jan Kara <jack@suse.cz> - 2016-10-03 12:00 +0200
[PATCH v4 07/12] dax: coordinate locking for offsets in PMD range Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range Christoph Hellwig <hch@infradead.org> - 2016-09-30 11:50 +0200
Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range Jan Kara <jack@suse.cz> - 2016-10-03 12:00 +0200
Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-03 20:50 +0200
[PATCH v4 01/12] ext4: allow DAX writeback for hole punch Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
[PATCH v4 04/12] ext2: remove support for DAX PMD faults Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 04/12] ext2: remove support for DAX PMD faults Jan Kara <jack@suse.cz> - 2016-10-03 11:40 +0200
[PATCH v4 03/12] dax: remove buffer_size_valid() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 03/12] dax: remove buffer_size_valid() Christoph Hellwig <hch@lst.de> - 2016-09-30 10:50 +0200
[PATCH v4 11/12] xfs: use struct iomap based DAX PMD fault path Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
[PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Christoph Hellwig <hch@infradead.org> - 2016-09-30 12:00 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-03 23:20 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-03 13:10 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Christoph Hellwig <hch@lst.de> - 2016-10-03 18:40 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-03 23:10 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-04 08:00 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-04 17:40 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-05 08:00 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-06 23:40 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-07 05:00 +0200
Re: [PATCH v4 10/12] dax: add struct iomap based DAX PMD support Jan Kara <jack@suse.cz> - 2016-10-07 09:50 +0200
[PATCH v4 08/12] dax: remove dax_pmd_fault() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 01:00 +0200
Re: [PATCH v4 08/12] dax: remove dax_pmd_fault() Jan Kara <jack@suse.cz> - 2016-10-03 12:00 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Dave Chinner <david@fromorbit.com> - 2016-09-30 01:50 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-09-30 05:10 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support "Darrick J. Wong" <darrick.wong@oracle.com> - 2016-09-30 06:10 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-03 21:00 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Dave Chinner <david@fromorbit.com> - 2016-09-30 08:50 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-03 23:20 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-04 01:10 +0200
Re: [PATCH v4 00/12] re-enable DAX PMD support Christoph Hellwig <hch@infradead.org> - 2016-09-30 13:50 +0200
Page 1 of 3 [1] 2 3 Next page →
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 00:50 +0200 |
| Subject | [PATCH v4 00/12] re-enable DAX PMD support |
| Message-ID | <smSjo-1SH-1@gated-at.bofh.it> |
DAX PMDs have been disabled since Jan Kara introduced DAX radix tree based locking. This series allows DAX PMDs to participate in the DAX radix tree based locking scheme so that they can be re-enabled. Ted, can you please take the ext2 + ext4 patches through your tree? Dave, can you please take the rest through the XFS tree? Changes since v3: - Corrected dax iomap code namespace for functions defined in fs/dax.c. (Dave Chinner) - Added leading "dax" namespace to new static functions in fs/dax.c. (Dave Chinner) - Made all DAX PMD code in fs/dax.c conditionally compiled based on CONFIG_FS_DAX_PMD. Otherwise a stub in include/linux/dax.h that just returns VM_FAULT_FALLBACK will be used. (Dave Chinner) - Removed dynamic debugging messages from DAX PMD fault path. Debugging tracepoints will be added later to both the PTE and PMD paths via a later patch set. (Dave Chinner) - Added a comment to ext2_dax_vm_ops explaining why we don't support DAX PMD faults in ext2. (Dave Chinner) This was built upon xfs/for-next with PMD performance fixes from Toshi Kani and Dan Williams. Dan's patch has already been merged for v4.8, and Toshi's patches are currently queued in Andrew Morton's mm tree for v4.9 inclusion. Here is a tree containing my changes and all the fixes that I've been testing: https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=dax_pmd_v4 This tree has passed xfstests for ext2, ext4 and XFS both with and without DAX, and has passed targeted testing where I inserted, removed and flushed DAX PTEs and PMDs in every combination I could think of. Previously reported performance numbers: In some simple mmap I/O testing with FIO the use of PMD faults more than doubles I/O performance as compared with PTE faults. Here is the FIO script I used for my testing: [global] bs=4k size=2G directory=/mnt/pmem0 ioengine=mmap [randrw] rw=randrw Here are the performance results with XFS using only pte faults: READ: io=1022.7MB, aggrb=557610KB/s, minb=557610KB/s, maxb=557610KB/s, mint=1878msec, maxt=1878msec WRITE: io=1025.4MB, aggrb=559084KB/s, minb=559084KB/s, maxb=559084KB/s, mint=1878msec, maxt=1878msec Here are performance numbers for that same test using PMD faults: READ: io=1022.7MB, aggrb=1406.7MB/s, minb=1406.7MB/s, maxb=1406.7MB/s, mint=727msec, maxt=727msec WRITE: io=1025.4MB, aggrb=1410.4MB/s, minb=1410.4MB/s, maxb=1410.4MB/s, mint=727msec, maxt=727msec This was done on a random lab machine with a PMEM device made from memmap'd RAM. To get XFS to use PMD faults, I did the following: mkfs.xfs -f -d su=2m,sw=1 /dev/pmem0 mount -o dax /dev/pmem0 /mnt/pmem0 xfs_io -c "extsize 2m" /mnt/pmem0 Ross Zwisler (12): 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: consistent variable naming for DAX entries dax: coordinate locking for offsets in PMD range dax: remove dax_pmd_fault() dax: correct dax iomap code namespace dax: add struct iomap based DAX PMD support xfs: use struct iomap based DAX PMD fault path dax: remove "depends on BROKEN" from FS_DAX_PMD fs/Kconfig | 1 - fs/dax.c | 650 +++++++++++++++++++++++++++------------------------- fs/ext2/file.c | 35 +-- fs/ext4/inode.c | 7 +- fs/xfs/xfs_aops.c | 25 +- fs/xfs/xfs_aops.h | 3 - fs/xfs/xfs_file.c | 10 +- include/linux/dax.h | 48 +++- mm/filemap.c | 6 +- 9 files changed, 402 insertions(+), 383 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 06/12] dax: consistent variable naming for DAX entries |
| Message-ID | <smSt3-1Wd-1@gated-at.bofh.it> |
| In reply to | #1493766 |
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 Zwisler <ross.zwisler@linux.intel.com>
---
fs/dax.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index ac28cdf..baef586 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -357,7 +357,7 @@ static inline void *unlock_slot(struct address_space *mapping, void **slot)
static void *get_unlocked_mapping_entry(struct address_space *mapping,
pgoff_t index, void ***slotp)
{
- void *ret, **slot;
+ void *entry, **slot;
struct wait_exceptional_entry_queue ewait;
wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index);
@@ -367,13 +367,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
ewait.key.index = index;
for (;;) {
- ret = __radix_tree_lookup(&mapping->page_tree, index, NULL,
+ entry = __radix_tree_lookup(&mapping->page_tree, index, NULL,
&slot);
- if (!ret || !radix_tree_exceptional_entry(ret) ||
+ if (!entry || !radix_tree_exceptional_entry(entry) ||
!slot_locked(mapping, slot)) {
if (slotp)
*slotp = slot;
- return ret;
+ return entry;
}
prepare_to_wait_exclusive(wq, &ewait.wait,
TASK_UNINTERRUPTIBLE);
@@ -396,13 +396,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
*/
static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
{
- void *ret, **slot;
+ void *entry, **slot;
restart:
spin_lock_irq(&mapping->tree_lock);
- ret = get_unlocked_mapping_entry(mapping, index, &slot);
+ entry = get_unlocked_mapping_entry(mapping, index, &slot);
/* No entry for given index? Make sure radix tree is big enough. */
- if (!ret) {
+ if (!entry) {
int err;
spin_unlock_irq(&mapping->tree_lock);
@@ -410,10 +410,10 @@ restart:
mapping_gfp_mask(mapping) & ~__GFP_HIGHMEM);
if (err)
return ERR_PTR(err);
- ret = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
+ entry = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
RADIX_DAX_ENTRY_LOCK);
spin_lock_irq(&mapping->tree_lock);
- err = radix_tree_insert(&mapping->page_tree, index, ret);
+ err = radix_tree_insert(&mapping->page_tree, index, entry);
radix_tree_preload_end();
if (err) {
spin_unlock_irq(&mapping->tree_lock);
@@ -425,11 +425,11 @@ restart:
/* Good, we have inserted empty locked entry into the tree. */
mapping->nrexceptional++;
spin_unlock_irq(&mapping->tree_lock);
- return ret;
+ return entry;
}
/* Normal page in radix tree? */
- if (!radix_tree_exceptional_entry(ret)) {
- struct page *page = ret;
+ if (!radix_tree_exceptional_entry(entry)) {
+ struct page *page = entry;
get_page(page);
spin_unlock_irq(&mapping->tree_lock);
@@ -442,9 +442,9 @@ restart:
}
return page;
}
- ret = lock_slot(mapping, slot);
+ entry = lock_slot(mapping, slot);
spin_unlock_irq(&mapping->tree_lock);
- return ret;
+ return entry;
}
void dax_wake_mapping_entry_waiter(struct address_space *mapping,
@@ -469,11 +469,11 @@ void dax_wake_mapping_entry_waiter(struct address_space *mapping,
void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index)
{
- void *ret, **slot;
+ void *entry, **slot;
spin_lock_irq(&mapping->tree_lock);
- ret = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot);
- if (WARN_ON_ONCE(!ret || !radix_tree_exceptional_entry(ret) ||
+ entry = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot);
+ if (WARN_ON_ONCE(!entry || !radix_tree_exceptional_entry(entry) ||
!slot_locked(mapping, slot))) {
spin_unlock_irq(&mapping->tree_lock);
return;
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-10-03 11:40 +0200 |
| Subject | Re: [PATCH v4 06/12] dax: consistent variable naming for DAX entries |
| Message-ID | <so7T3-35V-7@gated-at.bofh.it> |
| In reply to | #1493767 |
On Thu 29-09-16 16:49:24, Ross Zwisler wrote:
> 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 Zwisler <ross.zwisler@linux.intel.com>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/dax.c | 34 +++++++++++++++++-----------------
> 1 file changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index ac28cdf..baef586 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -357,7 +357,7 @@ static inline void *unlock_slot(struct address_space *mapping, void **slot)
> static void *get_unlocked_mapping_entry(struct address_space *mapping,
> pgoff_t index, void ***slotp)
> {
> - void *ret, **slot;
> + void *entry, **slot;
> struct wait_exceptional_entry_queue ewait;
> wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index);
>
> @@ -367,13 +367,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
> ewait.key.index = index;
>
> for (;;) {
> - ret = __radix_tree_lookup(&mapping->page_tree, index, NULL,
> + entry = __radix_tree_lookup(&mapping->page_tree, index, NULL,
> &slot);
> - if (!ret || !radix_tree_exceptional_entry(ret) ||
> + if (!entry || !radix_tree_exceptional_entry(entry) ||
> !slot_locked(mapping, slot)) {
> if (slotp)
> *slotp = slot;
> - return ret;
> + return entry;
> }
> prepare_to_wait_exclusive(wq, &ewait.wait,
> TASK_UNINTERRUPTIBLE);
> @@ -396,13 +396,13 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
> */
> static void *grab_mapping_entry(struct address_space *mapping, pgoff_t index)
> {
> - void *ret, **slot;
> + void *entry, **slot;
>
> restart:
> spin_lock_irq(&mapping->tree_lock);
> - ret = get_unlocked_mapping_entry(mapping, index, &slot);
> + entry = get_unlocked_mapping_entry(mapping, index, &slot);
> /* No entry for given index? Make sure radix tree is big enough. */
> - if (!ret) {
> + if (!entry) {
> int err;
>
> spin_unlock_irq(&mapping->tree_lock);
> @@ -410,10 +410,10 @@ restart:
> mapping_gfp_mask(mapping) & ~__GFP_HIGHMEM);
> if (err)
> return ERR_PTR(err);
> - ret = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
> + entry = (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
> RADIX_DAX_ENTRY_LOCK);
> spin_lock_irq(&mapping->tree_lock);
> - err = radix_tree_insert(&mapping->page_tree, index, ret);
> + err = radix_tree_insert(&mapping->page_tree, index, entry);
> radix_tree_preload_end();
> if (err) {
> spin_unlock_irq(&mapping->tree_lock);
> @@ -425,11 +425,11 @@ restart:
> /* Good, we have inserted empty locked entry into the tree. */
> mapping->nrexceptional++;
> spin_unlock_irq(&mapping->tree_lock);
> - return ret;
> + return entry;
> }
> /* Normal page in radix tree? */
> - if (!radix_tree_exceptional_entry(ret)) {
> - struct page *page = ret;
> + if (!radix_tree_exceptional_entry(entry)) {
> + struct page *page = entry;
>
> get_page(page);
> spin_unlock_irq(&mapping->tree_lock);
> @@ -442,9 +442,9 @@ restart:
> }
> return page;
> }
> - ret = lock_slot(mapping, slot);
> + entry = lock_slot(mapping, slot);
> spin_unlock_irq(&mapping->tree_lock);
> - return ret;
> + return entry;
> }
>
> void dax_wake_mapping_entry_waiter(struct address_space *mapping,
> @@ -469,11 +469,11 @@ void dax_wake_mapping_entry_waiter(struct address_space *mapping,
>
> void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index)
> {
> - void *ret, **slot;
> + void *entry, **slot;
>
> spin_lock_irq(&mapping->tree_lock);
> - ret = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot);
> - if (WARN_ON_ONCE(!ret || !radix_tree_exceptional_entry(ret) ||
> + entry = __radix_tree_lookup(&mapping->page_tree, index, NULL, &slot);
> + if (WARN_ON_ONCE(!entry || !radix_tree_exceptional_entry(entry) ||
> !slot_locked(mapping, slot))) {
> spin_unlock_irq(&mapping->tree_lock);
> return;
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 02/12] ext4: tell DAX the size of allocation holes |
| Message-ID | <smSt3-1Wd-13@gated-at.bofh.it> |
| In reply to | #1493766 |
When DAX calls _ext4_get_block() and the file offset points to a hole we
currently don't set bh->b_size. This is current worked around via
buffer_size_valid() in fs/dax.c.
_ext4_get_block() has the hole size information from ext4_map_blocks(), so
populate bh->b_size so we can remove buffer_size_valid() in a later patch.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
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 @@ static int _ext4_get_block(struct inode *inode, sector_t iblock,
ext4_update_bh_state(bh, map.m_flags);
bh->b_size = inode->i_sb->s_blocksize * map.m_len;
ret = 0;
+ } else if (ret == 0) {
+ /* hole case, need to fill in bh->b_size */
+ bh->b_size = inode->i_sb->s_blocksize * map.m_len;
}
return ret;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 05/12] dax: make 'wait_table' global variable static |
| Message-ID | <smSt3-1Wd-5@gated-at.bofh.it> |
| In reply to | #1493766 |
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-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
fs/dax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index 9b9be8a..ac28cdf 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -52,7 +52,7 @@
#define DAX_WAIT_TABLE_BITS 12
#define DAX_WAIT_TABLE_ENTRIES (1 << DAX_WAIT_TABLE_BITS)
-wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
+static wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
static int __init init_dax_wait_table(void)
{
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-10-03 11:40 +0200 |
| Subject | Re: [PATCH v4 05/12] dax: make 'wait_table' global variable static |
| Message-ID | <so7T4-35V-35@gated-at.bofh.it> |
| In reply to | #1493769 |
On Thu 29-09-16 16:49:23, Ross Zwisler wrote:
> 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-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Looks fine. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/dax.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 9b9be8a..ac28cdf 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -52,7 +52,7 @@
> #define DAX_WAIT_TABLE_BITS 12
> #define DAX_WAIT_TABLE_ENTRIES (1 << DAX_WAIT_TABLE_BITS)
>
> -wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
> +static wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
>
> static int __init init_dax_wait_table(void)
> {
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 12/12] dax: remove "depends on BROKEN" from FS_DAX_PMD |
| Message-ID | <smSt3-1Wd-3@gated-at.bofh.it> |
| In reply to | #1493766 |
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 <ross.zwisler@linux.intel.com> --- fs/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/Kconfig b/fs/Kconfig index 2bc7ad7..b6f0fce 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -55,7 +55,6 @@ config FS_DAX_PMD depends on FS_DAX depends on ZONE_DEVICE depends on TRANSPARENT_HUGEPAGE - depends on BROKEN endif # BLOCK -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 09/12] dax: correct dax iomap code namespace |
| Message-ID | <smSt4-1Wd-17@gated-at.bofh.it> |
| In reply to | #1493766 |
The recently added DAX functions that use the new struct iomap data
structure were named iomap_dax_rw(), iomap_dax_fault() and
iomap_dax_actor(). These are actually defined in fs/dax.c, though, so
should be part of the "dax" namespace and not the "iomap" namespace.
Rename them to dax_iomap_rw(), dax_iomap_fault() and dax_iomap_actor()
respectively.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Suggested-by: Dave Chinner <david@fromorbit.com>
---
fs/dax.c | 16 ++++++++--------
fs/ext2/file.c | 6 +++---
fs/xfs/xfs_file.c | 8 ++++----
include/linux/dax.h | 4 ++--
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b5e7b13..6977e5e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1024,7 +1024,7 @@ EXPORT_SYMBOL_GPL(dax_truncate_page);
#ifdef CONFIG_FS_IOMAP
static loff_t
-iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
+dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
struct iomap *iomap)
{
struct iov_iter *iter = data;
@@ -1081,7 +1081,7 @@ iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
}
/**
- * iomap_dax_rw - Perform I/O to a DAX file
+ * dax_iomap_rw - Perform I/O to a DAX file
* @iocb: The control block for this I/O
* @iter: The addresses to do I/O from or to
* @ops: iomap ops passed from the file system
@@ -1091,7 +1091,7 @@ iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
* and evicting any page cache pages in the region under I/O.
*/
ssize_t
-iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
+dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
struct iomap_ops *ops)
{
struct address_space *mapping = iocb->ki_filp->f_mapping;
@@ -1121,7 +1121,7 @@ iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
while (iov_iter_count(iter)) {
ret = iomap_apply(inode, pos, iov_iter_count(iter), flags, ops,
- iter, iomap_dax_actor);
+ iter, dax_iomap_actor);
if (ret <= 0)
break;
pos += ret;
@@ -1131,10 +1131,10 @@ iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
iocb->ki_pos += done;
return done ? done : ret;
}
-EXPORT_SYMBOL_GPL(iomap_dax_rw);
+EXPORT_SYMBOL_GPL(dax_iomap_rw);
/**
- * iomap_dax_fault - handle a page fault on a DAX file
+ * dax_iomap_fault - handle a page fault on a DAX file
* @vma: The virtual memory area where the fault occurred
* @vmf: The description of the fault
* @ops: iomap ops passed from the file system
@@ -1143,7 +1143,7 @@ EXPORT_SYMBOL_GPL(iomap_dax_rw);
* or mkwrite handler for DAX files. Assumes the caller has done all the
* necessary locking for the page fault to proceed successfully.
*/
-int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
+int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
struct iomap_ops *ops)
{
struct address_space *mapping = vma->vm_file->f_mapping;
@@ -1245,5 +1245,5 @@ int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
return VM_FAULT_SIGBUS | major;
return VM_FAULT_NOPAGE | major;
}
-EXPORT_SYMBOL_GPL(iomap_dax_fault);
+EXPORT_SYMBOL_GPL(dax_iomap_fault);
#endif /* CONFIG_FS_IOMAP */
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 0f257f8..32a4913 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -38,7 +38,7 @@ static ssize_t ext2_dax_read_iter(struct kiocb *iocb, struct iov_iter *to)
return 0; /* skip atime */
inode_lock_shared(inode);
- ret = iomap_dax_rw(iocb, to, &ext2_iomap_ops);
+ ret = dax_iomap_rw(iocb, to, &ext2_iomap_ops);
inode_unlock_shared(inode);
file_accessed(iocb->ki_filp);
@@ -62,7 +62,7 @@ static ssize_t ext2_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
if (ret)
goto out_unlock;
- ret = iomap_dax_rw(iocb, from, &ext2_iomap_ops);
+ ret = dax_iomap_rw(iocb, from, &ext2_iomap_ops);
if (ret > 0 && iocb->ki_pos > i_size_read(inode)) {
i_size_write(inode, iocb->ki_pos);
mark_inode_dirty(inode);
@@ -99,7 +99,7 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
}
down_read(&ei->dax_sem);
- ret = iomap_dax_fault(vma, vmf, &ext2_iomap_ops);
+ ret = dax_iomap_fault(vma, vmf, &ext2_iomap_ops);
up_read(&ei->dax_sem);
if (vmf->flags & FAULT_FLAG_WRITE)
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 882f264..00293d2 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -342,7 +342,7 @@ xfs_file_dax_read(
return 0; /* skip atime */
xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
- ret = iomap_dax_rw(iocb, to, &xfs_iomap_ops);
+ ret = dax_iomap_rw(iocb, to, &xfs_iomap_ops);
xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
file_accessed(iocb->ki_filp);
@@ -721,7 +721,7 @@ xfs_file_dax_write(
trace_xfs_file_dax_write(ip, count, pos);
- ret = iomap_dax_rw(iocb, from, &xfs_iomap_ops);
+ ret = dax_iomap_rw(iocb, from, &xfs_iomap_ops);
if (ret > 0 && iocb->ki_pos > i_size_read(inode)) {
i_size_write(inode, iocb->ki_pos);
error = xfs_setfilesize(ip, pos, ret);
@@ -1468,7 +1468,7 @@ xfs_filemap_page_mkwrite(
xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
if (IS_DAX(inode)) {
- ret = iomap_dax_fault(vma, vmf, &xfs_iomap_ops);
+ ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
} else {
ret = iomap_page_mkwrite(vma, vmf, &xfs_iomap_ops);
ret = block_page_mkwrite_return(ret);
@@ -1502,7 +1502,7 @@ xfs_filemap_fault(
* changes to xfs_get_blocks_direct() to map unwritten extent
* ioend for conversion on read-only mappings.
*/
- ret = iomap_dax_fault(vma, vmf, &xfs_iomap_ops);
+ ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
} else
ret = filemap_fault(vma, vmf);
xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
diff --git a/include/linux/dax.h b/include/linux/dax.h
index d9a8350..c4a51bb 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -11,13 +11,13 @@ struct iomap_ops;
/* We use lowest available exceptional entry bit for locking */
#define RADIX_DAX_ENTRY_LOCK (1 << RADIX_TREE_EXCEPTIONAL_SHIFT)
-ssize_t iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
+ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
struct iomap_ops *ops);
ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *,
get_block_t, dio_iodone_t, int flags);
int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
int dax_truncate_page(struct inode *, loff_t from, get_block_t);
-int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
+int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
struct iomap_ops *ops);
int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);
int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2016-09-30 11:00 +0200 |
| Subject | Re: [PATCH v4 09/12] dax: correct dax iomap code namespace |
| Message-ID | <sn1PN-7WT-27@gated-at.bofh.it> |
| In reply to | #1493771 |
On Thu, Sep 29, 2016 at 04:49:27PM -0600, Ross Zwisler wrote: > The recently added DAX functions that use the new struct iomap data > structure were named iomap_dax_rw(), iomap_dax_fault() and > iomap_dax_actor(). These are actually defined in fs/dax.c, though, so > should be part of the "dax" namespace and not the "iomap" namespace. > Rename them to dax_iomap_rw(), dax_iomap_fault() and dax_iomap_actor() > respectively. > > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> > Suggested-by: Dave Chinner <david@fromorbit.com> I don't really care either way, but this is trivial enought to not introduce a bug, so: Reviewed-by: Christoph Hellwig <hch@lst.de>
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-10-03 12:00 +0200 |
| Subject | Re: [PATCH v4 09/12] dax: correct dax iomap code namespace |
| Message-ID | <so8cr-3cD-67@gated-at.bofh.it> |
| In reply to | #1493771 |
On Thu 29-09-16 16:49:27, Ross Zwisler wrote:
> The recently added DAX functions that use the new struct iomap data
> structure were named iomap_dax_rw(), iomap_dax_fault() and
> iomap_dax_actor(). These are actually defined in fs/dax.c, though, so
> should be part of the "dax" namespace and not the "iomap" namespace.
> Rename them to dax_iomap_rw(), dax_iomap_fault() and dax_iomap_actor()
> respectively.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Suggested-by: Dave Chinner <david@fromorbit.com>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/dax.c | 16 ++++++++--------
> fs/ext2/file.c | 6 +++---
> fs/xfs/xfs_file.c | 8 ++++----
> include/linux/dax.h | 4 ++--
> 4 files changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index b5e7b13..6977e5e 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1024,7 +1024,7 @@ EXPORT_SYMBOL_GPL(dax_truncate_page);
>
> #ifdef CONFIG_FS_IOMAP
> static loff_t
> -iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> +dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> struct iomap *iomap)
> {
> struct iov_iter *iter = data;
> @@ -1081,7 +1081,7 @@ iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> }
>
> /**
> - * iomap_dax_rw - Perform I/O to a DAX file
> + * dax_iomap_rw - Perform I/O to a DAX file
> * @iocb: The control block for this I/O
> * @iter: The addresses to do I/O from or to
> * @ops: iomap ops passed from the file system
> @@ -1091,7 +1091,7 @@ iomap_dax_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
> * and evicting any page cache pages in the region under I/O.
> */
> ssize_t
> -iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
> +dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
> struct iomap_ops *ops)
> {
> struct address_space *mapping = iocb->ki_filp->f_mapping;
> @@ -1121,7 +1121,7 @@ iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
>
> while (iov_iter_count(iter)) {
> ret = iomap_apply(inode, pos, iov_iter_count(iter), flags, ops,
> - iter, iomap_dax_actor);
> + iter, dax_iomap_actor);
> if (ret <= 0)
> break;
> pos += ret;
> @@ -1131,10 +1131,10 @@ iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
> iocb->ki_pos += done;
> return done ? done : ret;
> }
> -EXPORT_SYMBOL_GPL(iomap_dax_rw);
> +EXPORT_SYMBOL_GPL(dax_iomap_rw);
>
> /**
> - * iomap_dax_fault - handle a page fault on a DAX file
> + * dax_iomap_fault - handle a page fault on a DAX file
> * @vma: The virtual memory area where the fault occurred
> * @vmf: The description of the fault
> * @ops: iomap ops passed from the file system
> @@ -1143,7 +1143,7 @@ EXPORT_SYMBOL_GPL(iomap_dax_rw);
> * or mkwrite handler for DAX files. Assumes the caller has done all the
> * necessary locking for the page fault to proceed successfully.
> */
> -int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
> +int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
> struct iomap_ops *ops)
> {
> struct address_space *mapping = vma->vm_file->f_mapping;
> @@ -1245,5 +1245,5 @@ int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
> return VM_FAULT_SIGBUS | major;
> return VM_FAULT_NOPAGE | major;
> }
> -EXPORT_SYMBOL_GPL(iomap_dax_fault);
> +EXPORT_SYMBOL_GPL(dax_iomap_fault);
> #endif /* CONFIG_FS_IOMAP */
> diff --git a/fs/ext2/file.c b/fs/ext2/file.c
> index 0f257f8..32a4913 100644
> --- a/fs/ext2/file.c
> +++ b/fs/ext2/file.c
> @@ -38,7 +38,7 @@ static ssize_t ext2_dax_read_iter(struct kiocb *iocb, struct iov_iter *to)
> return 0; /* skip atime */
>
> inode_lock_shared(inode);
> - ret = iomap_dax_rw(iocb, to, &ext2_iomap_ops);
> + ret = dax_iomap_rw(iocb, to, &ext2_iomap_ops);
> inode_unlock_shared(inode);
>
> file_accessed(iocb->ki_filp);
> @@ -62,7 +62,7 @@ static ssize_t ext2_dax_write_iter(struct kiocb *iocb, struct iov_iter *from)
> if (ret)
> goto out_unlock;
>
> - ret = iomap_dax_rw(iocb, from, &ext2_iomap_ops);
> + ret = dax_iomap_rw(iocb, from, &ext2_iomap_ops);
> if (ret > 0 && iocb->ki_pos > i_size_read(inode)) {
> i_size_write(inode, iocb->ki_pos);
> mark_inode_dirty(inode);
> @@ -99,7 +99,7 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
> }
> down_read(&ei->dax_sem);
>
> - ret = iomap_dax_fault(vma, vmf, &ext2_iomap_ops);
> + ret = dax_iomap_fault(vma, vmf, &ext2_iomap_ops);
>
> up_read(&ei->dax_sem);
> if (vmf->flags & FAULT_FLAG_WRITE)
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 882f264..00293d2 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -342,7 +342,7 @@ xfs_file_dax_read(
> return 0; /* skip atime */
>
> xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
> - ret = iomap_dax_rw(iocb, to, &xfs_iomap_ops);
> + ret = dax_iomap_rw(iocb, to, &xfs_iomap_ops);
> xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
>
> file_accessed(iocb->ki_filp);
> @@ -721,7 +721,7 @@ xfs_file_dax_write(
>
> trace_xfs_file_dax_write(ip, count, pos);
>
> - ret = iomap_dax_rw(iocb, from, &xfs_iomap_ops);
> + ret = dax_iomap_rw(iocb, from, &xfs_iomap_ops);
> if (ret > 0 && iocb->ki_pos > i_size_read(inode)) {
> i_size_write(inode, iocb->ki_pos);
> error = xfs_setfilesize(ip, pos, ret);
> @@ -1468,7 +1468,7 @@ xfs_filemap_page_mkwrite(
> xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
>
> if (IS_DAX(inode)) {
> - ret = iomap_dax_fault(vma, vmf, &xfs_iomap_ops);
> + ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
> } else {
> ret = iomap_page_mkwrite(vma, vmf, &xfs_iomap_ops);
> ret = block_page_mkwrite_return(ret);
> @@ -1502,7 +1502,7 @@ xfs_filemap_fault(
> * changes to xfs_get_blocks_direct() to map unwritten extent
> * ioend for conversion on read-only mappings.
> */
> - ret = iomap_dax_fault(vma, vmf, &xfs_iomap_ops);
> + ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
> } else
> ret = filemap_fault(vma, vmf);
> xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
> diff --git a/include/linux/dax.h b/include/linux/dax.h
> index d9a8350..c4a51bb 100644
> --- a/include/linux/dax.h
> +++ b/include/linux/dax.h
> @@ -11,13 +11,13 @@ struct iomap_ops;
> /* We use lowest available exceptional entry bit for locking */
> #define RADIX_DAX_ENTRY_LOCK (1 << RADIX_TREE_EXCEPTIONAL_SHIFT)
>
> -ssize_t iomap_dax_rw(struct kiocb *iocb, struct iov_iter *iter,
> +ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
> struct iomap_ops *ops);
> ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *,
> get_block_t, dio_iodone_t, int flags);
> int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
> int dax_truncate_page(struct inode *, loff_t from, get_block_t);
> -int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
> +int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
> struct iomap_ops *ops);
> int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);
> int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range |
| Message-ID | <smSt3-1Wd-7@gated-at.bofh.it> |
| In reply to | #1493766 |
DAX radix tree locking currently locks entries based on the unique
combination of the 'mapping' pointer and the pgoff_t 'index' for the entry.
This works for PTEs, but as we move to PMDs we will need to have all the
offsets within the range covered by the PMD to map to the 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 <ross.zwisler@linux.intel.com>
---
fs/dax.c | 37 ++++++++++++++++++++++++-------------
include/linux/dax.h | 2 +-
mm/filemap.c | 2 +-
3 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index baef586..406feea 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -64,10 +64,17 @@ static int __init init_dax_wait_table(void)
}
fs_initcall(init_dax_wait_table);
+static pgoff_t dax_entry_start(pgoff_t index, void *entry)
+{
+ if (RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD)
+ index &= (PMD_MASK >> PAGE_SHIFT);
+ return index;
+}
+
static wait_queue_head_t *dax_entry_waitqueue(struct address_space *mapping,
- pgoff_t index)
+ pgoff_t entry_start)
{
- unsigned long hash = hash_long((unsigned long)mapping ^ index,
+ unsigned long hash = hash_long((unsigned long)mapping ^ entry_start,
DAX_WAIT_TABLE_BITS);
return wait_table + hash;
}
@@ -285,7 +292,7 @@ EXPORT_SYMBOL_GPL(dax_do_io);
*/
struct exceptional_entry_key {
struct address_space *mapping;
- unsigned long index;
+ pgoff_t entry_start;
};
struct wait_exceptional_entry_queue {
@@ -301,7 +308,7 @@ static int wake_exceptional_entry_func(wait_queue_t *wait, unsigned int mode,
container_of(wait, struct wait_exceptional_entry_queue, wait);
if (key->mapping != ewait->key.mapping ||
- key->index != ewait->key.index)
+ key->entry_start != ewait->key.entry_start)
return 0;
return autoremove_wake_function(wait, mode, sync, NULL);
}
@@ -359,12 +366,10 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
{
void *entry, **slot;
struct wait_exceptional_entry_queue ewait;
- wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index);
+ wait_queue_head_t *wq;
init_wait(&ewait.wait);
ewait.wait.func = wake_exceptional_entry_func;
- ewait.key.mapping = mapping;
- ewait.key.index = index;
for (;;) {
entry = __radix_tree_lookup(&mapping->page_tree, index, NULL,
@@ -375,6 +380,11 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
*slotp = slot;
return entry;
}
+
+ wq = dax_entry_waitqueue(mapping,
+ dax_entry_start(index, entry));
+ ewait.key.mapping = mapping;
+ ewait.key.entry_start = dax_entry_start(index, entry);
prepare_to_wait_exclusive(wq, &ewait.wait,
TASK_UNINTERRUPTIBLE);
spin_unlock_irq(&mapping->tree_lock);
@@ -447,10 +457,11 @@ restart:
return entry;
}
-void dax_wake_mapping_entry_waiter(struct address_space *mapping,
+void dax_wake_mapping_entry_waiter(void *entry, struct address_space *mapping,
pgoff_t index, bool wake_all)
{
- wait_queue_head_t *wq = dax_entry_waitqueue(mapping, index);
+ wait_queue_head_t *wq = dax_entry_waitqueue(mapping,
+ dax_entry_start(index, entry));
/*
* Checking for locked entry and prepare_to_wait_exclusive() happens
@@ -462,7 +473,7 @@ void dax_wake_mapping_entry_waiter(struct address_space *mapping,
struct exceptional_entry_key key;
key.mapping = mapping;
- key.index = index;
+ key.entry_start = dax_entry_start(index, entry);
__wake_up(wq, TASK_NORMAL, wake_all ? 0 : 1, &key);
}
}
@@ -480,7 +491,7 @@ void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index)
}
unlock_slot(mapping, slot);
spin_unlock_irq(&mapping->tree_lock);
- dax_wake_mapping_entry_waiter(mapping, index, false);
+ dax_wake_mapping_entry_waiter(entry, mapping, index, false);
}
static void put_locked_mapping_entry(struct address_space *mapping,
@@ -505,7 +516,7 @@ static void put_unlocked_mapping_entry(struct address_space *mapping,
return;
/* We have to wake up next waiter for the radix tree entry lock */
- dax_wake_mapping_entry_waiter(mapping, index, false);
+ dax_wake_mapping_entry_waiter(entry, mapping, index, false);
}
/*
@@ -532,7 +543,7 @@ int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index)
radix_tree_delete(&mapping->page_tree, index);
mapping->nrexceptional--;
spin_unlock_irq(&mapping->tree_lock);
- dax_wake_mapping_entry_waiter(mapping, index, true);
+ dax_wake_mapping_entry_waiter(entry, mapping, index, true);
return 1;
}
diff --git a/include/linux/dax.h b/include/linux/dax.h
index add6c4b..4065601 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -21,7 +21,7 @@ int iomap_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
struct iomap_ops *ops);
int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t);
int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
-void dax_wake_mapping_entry_waiter(struct address_space *mapping,
+void dax_wake_mapping_entry_waiter(void *entry, struct address_space *mapping,
pgoff_t index, bool wake_all);
#ifdef CONFIG_FS_DAX
diff --git a/mm/filemap.c b/mm/filemap.c
index 8a287df..35e880d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -617,7 +617,7 @@ static int page_cache_tree_insert(struct address_space *mapping,
if (node)
workingset_node_pages_dec(node);
/* Wakeup waiters for exceptional entry lock */
- dax_wake_mapping_entry_waiter(mapping, page->index,
+ dax_wake_mapping_entry_waiter(p, mapping, page->index,
false);
}
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-09-30 11:50 +0200 |
| Subject | Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range |
| Message-ID | <sn2C5-8sS-13@gated-at.bofh.it> |
| In reply to | #1493772 |
> +static pgoff_t dax_entry_start(pgoff_t index, void *entry)
> +{
> + if (RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD)
> + index &= (PMD_MASK >> PAGE_SHIFT);
> + return index;
> +}
> +
> static wait_queue_head_t *dax_entry_waitqueue(struct address_space *mapping,
> - pgoff_t index)
> + pgoff_t entry_start)
> {
> - unsigned long hash = hash_long((unsigned long)mapping ^ index,
> + unsigned long hash = hash_long((unsigned long)mapping ^ entry_start,
> DAX_WAIT_TABLE_BITS);
> return wait_table + hash;
> }
All callers of dax_entry_waitqueue need to calculate entry_start
using this new dax_entry_start helper. Either we should move the
call to dax_entry_start into this helper. Or at least use local
variables for in the callers as both of them also fill out a
wait_exceptional_entry_queue structure with it. Or do both by
letting dax_entry_waitqueue fill out that structure as well.
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-10-03 12:00 +0200 |
| Subject | Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range |
| Message-ID | <so8cr-3cD-63@gated-at.bofh.it> |
| In reply to | #1493772 |
On Thu 29-09-16 16:49:25, Ross Zwisler wrote:
> DAX radix tree locking currently locks entries based on the unique
> combination of the 'mapping' pointer and the pgoff_t 'index' for the entry.
> This works for PTEs, but as we move to PMDs we will need to have all the
> offsets within the range covered by the PMD to map to the 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 <ross.zwisler@linux.intel.com>
> ---
> fs/dax.c | 37 ++++++++++++++++++++++++-------------
> include/linux/dax.h | 2 +-
> mm/filemap.c | 2 +-
> 3 files changed, 26 insertions(+), 15 deletions(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index baef586..406feea 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -64,10 +64,17 @@ static int __init init_dax_wait_table(void)
> }
> fs_initcall(init_dax_wait_table);
>
> +static pgoff_t dax_entry_start(pgoff_t index, void *entry)
> +{
> + if (RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD)
> + index &= (PMD_MASK >> PAGE_SHIFT);
Hum, but if we shift right, top bits of PMD_MASK will become zero - not
something we want I guess... You rather want to mask with something like:
~((1UL << (PMD_SHIFT - PAGE_SHIFT)) - 1)
> @@ -447,10 +457,11 @@ restart:
> return entry;
> }
>
> -void dax_wake_mapping_entry_waiter(struct address_space *mapping,
> +void dax_wake_mapping_entry_waiter(void *entry, struct address_space *mapping,
> pgoff_t index, bool wake_all)
Nitpick: Ordering of arguments would look more logical to me like:
dax_wake_mapping_entry_waiter(mapping, index, entry, wake_all)
Other than that the patch looks good to me.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-10-03 20:50 +0200 |
| Subject | Re: [PATCH v4 07/12] dax: coordinate locking for offsets in PMD range |
| Message-ID | <sogtj-5C-21@gated-at.bofh.it> |
| In reply to | #1494797 |
On Mon, Oct 03, 2016 at 11:55:18AM +0200, Jan Kara wrote:
> On Thu 29-09-16 16:49:25, Ross Zwisler wrote:
> > DAX radix tree locking currently locks entries based on the unique
> > combination of the 'mapping' pointer and the pgoff_t 'index' for the entry.
> > This works for PTEs, but as we move to PMDs we will need to have all the
> > offsets within the range covered by the PMD to map to the 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 <ross.zwisler@linux.intel.com>
> > ---
> > fs/dax.c | 37 ++++++++++++++++++++++++-------------
> > include/linux/dax.h | 2 +-
> > mm/filemap.c | 2 +-
> > 3 files changed, 26 insertions(+), 15 deletions(-)
> >
> > diff --git a/fs/dax.c b/fs/dax.c
> > index baef586..406feea 100644
> > --- a/fs/dax.c
> > +++ b/fs/dax.c
> > @@ -64,10 +64,17 @@ static int __init init_dax_wait_table(void)
> > }
> > fs_initcall(init_dax_wait_table);
> >
> > +static pgoff_t dax_entry_start(pgoff_t index, void *entry)
> > +{
> > + if (RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD)
> > + index &= (PMD_MASK >> PAGE_SHIFT);
>
> Hum, but if we shift right, top bits of PMD_MASK will become zero - not
> something we want I guess... You rather want to mask with something like:
> ~((1UL << (PMD_SHIFT - PAGE_SHIFT)) - 1)
Great catch, thanks. Fixed for v5.
> > @@ -447,10 +457,11 @@ restart:
> > return entry;
> > }
> >
> > -void dax_wake_mapping_entry_waiter(struct address_space *mapping,
> > +void dax_wake_mapping_entry_waiter(void *entry, struct address_space *mapping,
> > pgoff_t index, bool wake_all)
>
> Nitpick: Ordering of arguments would look more logical to me like:
>
> dax_wake_mapping_entry_waiter(mapping, index, entry, wake_all)
Cool, I'll reorder them for v5.
Thanks for the review!
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 01/12] ext4: allow DAX writeback for hole punch |
| Message-ID | <smSt4-1Wd-25@gated-at.bofh.it> |
| In reply to | #1493766 |
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 <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: <stable@vger.kernel.org>
---
fs/ext4/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3131747..0900cb4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3890,7 +3890,7 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
}
/*
- * ext4_punch_hole: punches a hole in a file by releaseing the blocks
+ * ext4_punch_hole: punches a hole in a file by releasing the blocks
* associated with the given offset and length
*
* @inode: File inode
@@ -3919,7 +3919,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
* Write out all dirty pages to avoid race conditions
* Then release them.
*/
- if (mapping->nrpages && mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
+ if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
ret = filemap_write_and_wait_range(mapping, offset,
offset + length - 1);
if (ret)
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 04/12] ext2: remove support for DAX PMD faults |
| Message-ID | <smSt3-1Wd-11@gated-at.bofh.it> |
| In reply to | #1493766 |
DAX PMD support was added via the following commit:
commit e7b1ea2ad658 ("ext2: huge page fault support")
I believe this path to be untested as ext2 doesn't reliably provide block
allocations that are aligned to 2MiB. In my testing I've been unable to
get ext2 to actually fault in a PMD. It always fails with a "pfn
unaligned" message because the sector returned by ext2_get_block() isn't
aligned.
I've tried various settings for the "stride" and "stripe_width" extended
options to mkfs.ext2, without any luck.
Since we can'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 response of VM_FAULT_FALLBACK.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
fs/ext2/file.c | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 0ca363d..0f257f8 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -107,27 +107,6 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
return ret;
}
-static int ext2_dax_pmd_fault(struct vm_area_struct *vma, unsigned long addr,
- pmd_t *pmd, unsigned int flags)
-{
- struct inode *inode = file_inode(vma->vm_file);
- struct ext2_inode_info *ei = EXT2_I(inode);
- int ret;
-
- if (flags & FAULT_FLAG_WRITE) {
- sb_start_pagefault(inode->i_sb);
- file_update_time(vma->vm_file);
- }
- down_read(&ei->dax_sem);
-
- ret = dax_pmd_fault(vma, addr, pmd, flags, ext2_get_block);
-
- up_read(&ei->dax_sem);
- if (flags & FAULT_FLAG_WRITE)
- sb_end_pagefault(inode->i_sb);
- return ret;
-}
-
static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
struct vm_fault *vmf)
{
@@ -154,7 +133,11 @@ static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
static const struct vm_operations_struct ext2_dax_vm_ops = {
.fault = ext2_dax_fault,
- .pmd_fault = ext2_dax_pmd_fault,
+ /*
+ * .pmd_fault is not supported for DAX because allocation in ext2
+ * cannot be reliably aligned to huge page sizes and so pmd faults
+ * will always fail and fail back to regular faults.
+ */
.page_mkwrite = ext2_dax_fault,
.pfn_mkwrite = ext2_dax_pfn_mkwrite,
};
@@ -166,7 +149,7 @@ static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
file_accessed(file);
vma->vm_ops = &ext2_dax_vm_ops;
- vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
+ vma->vm_flags |= VM_MIXEDMAP;
return 0;
}
#else
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-10-03 11:40 +0200 |
| Subject | Re: [PATCH v4 04/12] ext2: remove support for DAX PMD faults |
| Message-ID | <so7T3-35V-27@gated-at.bofh.it> |
| In reply to | #1493774 |
On Thu 29-09-16 16:49:22, Ross Zwisler wrote:
> DAX PMD support was added via the following commit:
>
> commit e7b1ea2ad658 ("ext2: huge page fault support")
>
> I believe this path to be untested as ext2 doesn't reliably provide block
> allocations that are aligned to 2MiB. In my testing I've been unable to
> get ext2 to actually fault in a PMD. It always fails with a "pfn
> unaligned" message because the sector returned by ext2_get_block() isn't
> aligned.
>
> I've tried various settings for the "stride" and "stripe_width" extended
> options to mkfs.ext2, without any luck.
>
> Since we can'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 response of VM_FAULT_FALLBACK.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext2/file.c | 29 ++++++-----------------------
> 1 file changed, 6 insertions(+), 23 deletions(-)
>
> diff --git a/fs/ext2/file.c b/fs/ext2/file.c
> index 0ca363d..0f257f8 100644
> --- a/fs/ext2/file.c
> +++ b/fs/ext2/file.c
> @@ -107,27 +107,6 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
> return ret;
> }
>
> -static int ext2_dax_pmd_fault(struct vm_area_struct *vma, unsigned long addr,
> - pmd_t *pmd, unsigned int flags)
> -{
> - struct inode *inode = file_inode(vma->vm_file);
> - struct ext2_inode_info *ei = EXT2_I(inode);
> - int ret;
> -
> - if (flags & FAULT_FLAG_WRITE) {
> - sb_start_pagefault(inode->i_sb);
> - file_update_time(vma->vm_file);
> - }
> - down_read(&ei->dax_sem);
> -
> - ret = dax_pmd_fault(vma, addr, pmd, flags, ext2_get_block);
> -
> - up_read(&ei->dax_sem);
> - if (flags & FAULT_FLAG_WRITE)
> - sb_end_pagefault(inode->i_sb);
> - return ret;
> -}
> -
> static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
> struct vm_fault *vmf)
> {
> @@ -154,7 +133,11 @@ static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
>
> static const struct vm_operations_struct ext2_dax_vm_ops = {
> .fault = ext2_dax_fault,
> - .pmd_fault = ext2_dax_pmd_fault,
> + /*
> + * .pmd_fault is not supported for DAX because allocation in ext2
> + * cannot be reliably aligned to huge page sizes and so pmd faults
> + * will always fail and fail back to regular faults.
> + */
> .page_mkwrite = ext2_dax_fault,
> .pfn_mkwrite = ext2_dax_pfn_mkwrite,
> };
> @@ -166,7 +149,7 @@ static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
>
> file_accessed(file);
> vma->vm_ops = &ext2_dax_vm_ops;
> - vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
> + vma->vm_flags |= VM_MIXEDMAP;
> return 0;
> }
> #else
> --
> 2.7.4
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 03/12] dax: remove buffer_size_valid() |
| Message-ID | <smSt3-1Wd-15@gated-at.bofh.it> |
| In reply to | #1493766 |
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 <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
fs/dax.c | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index cc025f8..9b9be8a 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -123,19 +123,6 @@ static bool buffer_written(struct buffer_head *bh)
return buffer_mapped(bh) && !buffer_unwritten(bh);
}
-/*
- * When ext4 encounters a hole, it returns without modifying the buffer_head
- * which means that we can't trust b_size. To cope with this, we set b_state
- * to 0 before calling get_block and, if any bit is set, we know we can trust
- * b_size. Unfortunate, really, since ext4 knows precisely how long a hole is
- * and would save us time calling get_block repeatedly.
- */
-static bool buffer_size_valid(struct buffer_head *bh)
-{
- return bh->b_state != 0;
-}
-
-
static sector_t to_sector(const struct buffer_head *bh,
const struct inode *inode)
{
@@ -177,8 +164,6 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
rc = get_block(inode, block, bh, rw == WRITE);
if (rc)
break;
- if (!buffer_size_valid(bh))
- bh->b_size = 1 << blkbits;
bh_max = pos - first + bh->b_size;
bdev = bh->b_bdev;
/*
@@ -1012,12 +997,7 @@ int dax_pmd_fault(struct vm_area_struct *vma, unsigned long address,
bdev = bh.b_bdev;
- /*
- * If the filesystem isn't willing to tell us the length of a hole,
- * just fall back to PTEs. Calling get_block 512 times in a loop
- * would be silly.
- */
- if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE) {
+ if (bh.b_size < PMD_SIZE) {
dax_pmd_dbg(&bh, address, "allocated block too small");
return VM_FAULT_FALLBACK;
}
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2016-09-30 10:50 +0200 |
| Subject | Re: [PATCH v4 03/12] dax: remove buffer_size_valid() |
| Message-ID | <sn1G2-7Tg-19@gated-at.bofh.it> |
| In reply to | #1493775 |
Looks fine, Reviewed-by: Christoph Hellwig <hch@lst.de>
[toc] | [prev] | [next] | [standalone]
| From | Ross Zwisler <ross.zwisler@linux.intel.com> |
|---|---|
| Date | 2016-09-30 01:00 +0200 |
| Subject | [PATCH v4 11/12] xfs: use struct iomap based DAX PMD fault path |
| Message-ID | <smSt4-1Wd-19@gated-at.bofh.it> |
| In reply to | #1493766 |
Switch xfs_filemap_pmd_fault() from using dax_pmd_fault() to the new and
improved dax_iomap_pmd_fault(). Also, now that it has no more users,
remove xfs_get_blocks_dax_fault().
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
fs/xfs/xfs_aops.c | 25 +++++--------------------
fs/xfs/xfs_aops.h | 3 ---
fs/xfs/xfs_file.c | 2 +-
3 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 4a28fa9..39c754f 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -1170,8 +1170,7 @@ __xfs_get_blocks(
sector_t iblock,
struct buffer_head *bh_result,
int create,
- bool direct,
- bool dax_fault)
+ bool direct)
{
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
@@ -1265,12 +1264,8 @@ __xfs_get_blocks(
if (ISUNWRITTEN(&imap))
set_buffer_unwritten(bh_result);
/* direct IO needs special help */
- if (create) {
- if (dax_fault)
- ASSERT(!ISUNWRITTEN(&imap));
- else
- xfs_map_direct(inode, bh_result, &imap, offset);
- }
+ if (create)
+ xfs_map_direct(inode, bh_result, &imap, offset);
}
/*
@@ -1310,7 +1305,7 @@ xfs_get_blocks(
struct buffer_head *bh_result,
int create)
{
- return __xfs_get_blocks(inode, iblock, bh_result, create, false, false);
+ return __xfs_get_blocks(inode, iblock, bh_result, create, false);
}
int
@@ -1320,17 +1315,7 @@ xfs_get_blocks_direct(
struct buffer_head *bh_result,
int create)
{
- return __xfs_get_blocks(inode, iblock, bh_result, create, true, false);
-}
-
-int
-xfs_get_blocks_dax_fault(
- struct inode *inode,
- sector_t iblock,
- struct buffer_head *bh_result,
- int create)
-{
- return __xfs_get_blocks(inode, iblock, bh_result, create, true, true);
+ return __xfs_get_blocks(inode, iblock, bh_result, create, true);
}
/*
diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h
index 1950e3b..6779e9d 100644
--- a/fs/xfs/xfs_aops.h
+++ b/fs/xfs/xfs_aops.h
@@ -57,9 +57,6 @@ int xfs_get_blocks(struct inode *inode, sector_t offset,
struct buffer_head *map_bh, int create);
int xfs_get_blocks_direct(struct inode *inode, sector_t offset,
struct buffer_head *map_bh, int create);
-int xfs_get_blocks_dax_fault(struct inode *inode, sector_t offset,
- struct buffer_head *map_bh, int create);
-
int xfs_end_io_direct_write(struct kiocb *iocb, loff_t offset,
ssize_t size, void *private);
int xfs_setfilesize(struct xfs_inode *ip, xfs_off_t offset, size_t size);
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 00293d2..ab8f652 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1539,7 +1539,7 @@ xfs_filemap_pmd_fault(
}
xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
- ret = dax_pmd_fault(vma, addr, pmd, flags, xfs_get_blocks_dax_fault);
+ ret = dax_iomap_pmd_fault(vma, addr, pmd, flags, &xfs_iomap_ops);
xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
if (flags & FAULT_FLAG_WRITE)
--
2.7.4
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | linux.kernel
csiph-web