Re: Btrfs for mainline

2009-01-03 Thread Matthew Wilcox
On Sat, Jan 03, 2009 at 02:50:34PM -0500, Christoph Hellwig wrote: On Sat, Jan 03, 2009 at 12:17:06PM -0700, Matthew Wilcox wrote: It's no worse than XFS (which still has its own implementation of 'synchronisation variables', Which are a trivial wrapper around wait queues. I have patches

Re: Btrfs for mainline

2009-01-04 Thread Matthew Wilcox
be reluctant to reverse that decision just for btrfs. Benchmarking required! Maybe I can put a patch together that implements the simple 'spin if it's running' heuristic and throw it at our testing guys on Monday ... -- Matthew Wilcox Intel Open Source Technology Centre

Re: Btrfs for mainline

2009-01-05 Thread Matthew Wilcox
. -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH][RFC]: mutex: adaptive spin

2009-01-06 Thread Matthew Wilcox
(). That would make the whole exercise rather pointless; the only time worth spinning really is if you're the only other one waiting for it ... if there's already a waiter, you might as well go to sleep. -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we

Re: Btrfs for mainline

2009-01-07 Thread Matthew Wilcox
? Such as: Um, I don't know how your mail client does threading, but mine shows Peter's message introducing the adaptive spinning mutexes as a reply to one of Chris' messages in the btrfs thread. Chris is just saying he'll look at other ways to not need the spinning mutexes. -- Matthew Wilcox

Re: [PATCH][RFC]: mutex: adaptive spin

2009-01-07 Thread Matthew Wilcox
On Wed, Jan 07, 2009 at 03:34:47PM +0800, Lai Jiangshan wrote: So I think current task should sleep earlier when it detects that mutex owner start schedule(). How do you propose it detects this? -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we

Re: [PATCH -v5][RFC]: mutex: implement adaptive spinning

2009-01-07 Thread Matthew Wilcox
have an appropriate function for kernel space pointers? Is this a good reason to add one? -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly

Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact

2009-01-09 Thread Matthew Wilcox
fixed with gcc 4.4. Does anyone want to test that? -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step

Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact

2009-01-09 Thread Matthew Wilcox
On Fri, Jan 09, 2009 at 06:47:19PM +0100, Andi Kleen wrote: On Fri, Jan 09, 2009 at 10:28:01AM -0700, Matthew Wilcox wrote: On Fri, Jan 09, 2009 at 06:20:11PM +0100, Andi Kleen wrote: Also cc Honza in case he has comments (you might want to review more of the thread in the archives

Re: [GIT PULL] adaptive spinning mutexes

2009-01-15 Thread Matthew Wilcox
for most workloads. Has anyone found a non-synthetic benchmark where this makes a significant difference? Aside from btrfs, I mean. -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system

Re: btrfs for enterprise raid arrays

2009-04-03 Thread Matthew Wilcox
On Fri, Apr 03, 2009 at 12:58:00PM +0100, David Woodhouse wrote: On Fri, 2009-04-03 at 12:43 +0100, Ric Wheeler wrote: New firmware/microcode versions are able to reclaim that space if it sees a certain number of consecutive zero's and will reclaim that space to the volume pool. Are

Re: [PATCH 1/2] fs: add SEEK_HOLE and SEEK_DATA flags

2011-04-21 Thread Matthew Wilcox
! -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe

Re: Is it possible for the ext4/btrfs file system to pass some context related info to low level block driver?

2011-05-05 Thread Matthew Wilcox
/linux/fs.h:164:#define READ_META(READ | REQ_META) include/linux/fs.h:168:#define WRITE_META (WRITE | REQ_META) btrfs seems to not use REQ_META yet. *poke* *poke* :-) -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we

Re: [PATCH 3/4] fsfreeze: manage kill signal when sb_start_pagefault is called

2013-04-06 Thread Matthew Wilcox
, PAGE_CACHE_SIZE); Does the compiler not warn that you're assigning void to 'ret'? Or was there some other SNAFU sending these patches? -- Matthew Wilcox Intel Open Source Technology Centre Bill, look, we understand that you're interested in selling us this operating system

Re: [PATCH 2/4] fsfreeze: manage kill signal when sb_start_write is called

2013-04-06 Thread Matthew Wilcox
On Sat, Apr 06, 2013 at 12:04:52PM +0200, Marco Stornelli wrote: In every place where sb_start_write was called now we must manage the error code and return -EINTR. If we must manage the error code, then these functions should be marked __must_check. -- Matthew Wilcox

Re: [PATCH] dax: allow DAX to look up an inode's block device

2016-02-02 Thread Matthew Wilcox
On Tue, Feb 02, 2016 at 03:39:15PM -0800, Dan Williams wrote: > On Tue, Feb 2, 2016 at 3:19 PM, Al Viro wrote: > > On Tue, Feb 02, 2016 at 04:11:42PM -0700, Ross Zwisler wrote: > >> However, for raw block devices and for XFS with a real-time device, the > >> value in

Re: [PATCH 1/6] lockdep: allow to disable reclaim lockup detection

2017-02-06 Thread Matthew Wilcox
On Mon, Feb 06, 2017 at 03:07:13PM +0100, Michal Hocko wrote: > While we are at it also make sure that the radix tree doesn't > accidentaly override tags stored in the upper part of the gfp_mask. > diff --git a/lib/radix-tree.c b/lib/radix-tree.c > index 9dc093d5ef39..7550be09f9d6 100644 > ---

Re: [PATCH 1/6] lockdep: allow to disable reclaim lockup detection

2017-02-06 Thread Matthew Wilcox
On Mon, Feb 06, 2017 at 03:34:50PM +0100, Michal Hocko wrote: > This part is not needed for the patch, strictly speaking but I wanted to > make the code more future proof. Understood. I took an extra bit myself for marking the radix tree as being used for an IDR (so the radix tree now uses 4

Re: [PATCH 4/6] xfs: use memalloc_nofs_{save,restore} instead of memalloc_noio*

2017-02-06 Thread Matthew Wilcox
On Mon, Feb 06, 2017 at 03:07:16PM +0100, Michal Hocko wrote: > +++ b/fs/xfs/xfs_buf.c > @@ -442,17 +442,17 @@ _xfs_buf_map_pages( > bp->b_addr = NULL; > } else { > int retried = 0; > - unsigned noio_flag; > + unsigned nofs_flag; > >

Re: [PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-03-02 Thread Matthew Wilcox
On Thu, Mar 02, 2017 at 11:38:45AM +0100, Jan Kara wrote: > On Wed 01-03-17 07:38:57, Christoph Hellwig wrote: > > On Tue, Feb 28, 2017 at 07:46:06PM -0800, Matthew Wilcox wrote: > > > But what's going to kick these pages out of cache? Shouldn't we rather > > > fi

Re: [PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-03-16 Thread Matthew Wilcox
On Wed, Mar 15, 2017 at 04:51:02PM -0500, Goldwyn Rodrigues wrote: > This introduces a new function filemap_range_has_page() which > returns true if the file's mapping has a page within the range > mentioned. I thought you were going to replace this patch with one that starts writeback for these

Re: [PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-03-16 Thread Matthew Wilcox
On Wed, Mar 15, 2017 at 04:51:02PM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > Find out if the write will trigger a wait due to writeback. If yes, > return -EAGAIN. > > This introduces a new function filemap_range_has_page() which > returns true if the

Re: [PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-02-28 Thread Matthew Wilcox
On Tue, Feb 28, 2017 at 05:36:05PM -0600, Goldwyn Rodrigues wrote: > Find out if the write will trigger a wait due to writeback. If yes, > return -EAGAIN. > > This introduces a new function filemap_range_has_page() which > returns true if the file's mapping has a page within the range >

RE: [PATCH v8 12/18] Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors

2017-06-29 Thread Matthew Wilcox
From: Jeff Layton [mailto:jlay...@poochiereds.net] > On Thu, 2017-06-29 at 10:11 -0700, Darrick J. Wong wrote: > > On Thu, Jun 29, 2017 at 09:19:48AM -0400, jlay...@kernel.org wrote: > > > +Handling errors during writeback > > > + > > > +Most applications that

Re: [PATCH v4 13/27] lib: add errseq_t type and infrastructure for handling it

2017-05-10 Thread Matthew Wilcox
On Tue, May 09, 2017 at 11:49:16AM -0400, Jeff Layton wrote: > +++ b/lib/errseq.c > @@ -0,0 +1,199 @@ > +#include > +#include > +#include > +#include > + > +/* > + * An errseq_t is a way of recording errors in one place, and allowing any > + * number of "subscribers" to tell whether it has

Re: [PATCH v4 06/27] fs: check for writeback errors after syncing out buffers in generic_file_fsync

2017-05-10 Thread Matthew Wilcox
t; > Reviewed-by: Christoph Hellwig <h...@lst.de> > Reviewed-by: Jan Kara <j...@suse.cz> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Something like ZFS Channel Programs for BTRFS & probably XFS or even VFS?

2017-10-03 Thread Matthew Wilcox
On Wed, Oct 04, 2017 at 07:10:35AM +1100, Dave Chinner wrote: > On Tue, Oct 03, 2017 at 03:19:18PM +0200, Martin Steigerwald wrote: > > [repost. I didnĀ“t notice autocompletion gave me wrong address for fsdevel, > > blacklisted now] > > > > Hello. > > > > What do you think of > > > >

Re: [PATCH v4 08/73] xarray: Add documentation

2017-12-14 Thread Matthew Wilcox
On Mon, Dec 11, 2017 at 03:10:22PM -0800, Randy Dunlap wrote: > > +A freshly-initialised XArray contains a ``NULL`` pointer at every index. > > +Each non-``NULL`` entry in the array has three bits associated with > > +it called tags. Each tag may be flipped on or off independently of > > +the

[PATCH v5 52/78] btrfs: Convert page cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/btrfs/compression.c | 4 +--- fs/btrfs/extent_io.c | 6 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compres

[PATCH v5 37/78] mm: Convert page migration to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/migrate.c | 41 - 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 75d19904dd9a..

[PATCH v5 65/78] dax: Convert grab_mapping_entry to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 98 +--- 1 file changed, 26 insertions(+), 72 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index

Storing errors in the XArray

2017-12-15 Thread Matthew Wilcox
On Mon, Dec 11, 2017 at 03:10:22PM -0800, Randy Dunlap wrote: > > +The XArray does not support storing :c:func:`IS_ERR` pointers; some > > +conflict with data values and others conflict with entries the XArray > > +uses for its own purposes. If you need to store special values which > > +cannot

[PATCH v5 38/78] mm: Convert huge_memory to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Quite a straightforward conversion. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/huge_memory.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_me

[PATCH v5 03/78] xarray: Add the xa_lock to the radix_tree_root

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This results in no change in structure size on 64-bit x86 as it fits in the padding between the gfp_t and the void *. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/f2fs/gc.c | 2 +- include

[PATCH v5 28/78] page cache: Convert page cache lookups to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Introduce page_cache_pin() to factor out the common logic between the various lookup routines: find_get_entry find_get_entries find_get_pages_range find_get_pages_contig find_get_pages_range_tag find_get_entries_tag filemap_map_pages By

[PATCH v5 46/78] shmem: Convert shmem_wait_for_pins to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> As with shmem_tag_pins(), hold the lock around the entire loop instead of acquiring & dropping it for each entry we're going to untag. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> ---

[PATCH v5 15/78] xarray: Add xas_for_each_tag

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This iterator operates across each tagged entry in the specified range. We do not yet have a user for an xa_for_each_tag iterator, but it would be straight-forward to add one if needed. This commit also includes xas_find_tag() and xas_ne

[PATCH v5 50/78] shmem: Convert shmem_partial_swap_usage to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simpler code because the xarray takes care of things like the limit and dereferencing the slot. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/shmem.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deleti

[PATCH v5 05/78] xarray: Replace exceptional entries

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Introduce xarray value entries to replace the radix tree exceptional entry code. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in em

[PATCH v5 10/78] xarray: Add xa_load

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This first function in the XArray API brings with it a lot of support infrastructure. The advanced API is based around the xa_state which is a more capable version of the radix_tree_iter. As the test-suite demonstrates, it is possible

[PATCH v5 11/78] xarray: Add xa_get_tag, xa_set_tag and xa_clear_tag

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> XArray tags are slightly more strongly typed than the radix tree tags, but occupy the same bits. This commit also adds the xas_ family of tag operations, for cases where the caller is already holding the lock, and xa_tagged() to ask whether any

[PATCH v5 78/78] fscache: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Removes another user of radix_tree_preload(). Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/fscache/cookie.c | 6 +- fs/fscache/internal.h | 2 +- fs/fscache/object.c | 2 +- fs/fscache/page.c

[PATCH v5 16/78] xarray: Add xa_get_entries, xa_get_tagged and xa_get_maybe_tag

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> These functions allow a range of xarray entries to be extracted into a compact normal array. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/xarray.h | 27 lib/xarray.c

[PATCH v5 43/78] shmem: Convert shmem_confirm_swap to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/shmem.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index

[PATCH v5 76/78] md: Convert raid5-cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is the first user of the radix tree I've converted which was storing numbers rather than pointers. I'm fairly pleased with how well it came out. There's less boiler-plate involved than there was with the radix tree, so that's a win. I

[PATCH v5 01/78] xfs: Rename xa_ elements to ail_

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a simple rename, except that xa_ail becomes ail_head. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/xfs/xfs_buf_item.c| 10 ++-- fs/xfs/xfs_dquot.c | 4 +- fs/xfs/xfs_dquot_item.c | 11

[PATCH v5 07/78] xarray: Add definition of struct xarray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a direct replacement for struct radix_tree_root. Some of the struct members have changed name; convert those, and use a #define so that radix_tree users continue to work without change. Signed-off-by: Matthew Wilcox <mawil...@micr

[PATCH v5 09/78] xarray: Add documentation

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is documentation on how to use the XArray, not details about its internal implementation. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- Documentation/core-api/index.rst | 1 + Documentation/core-api/xarr

[PATCH v5 36/78] mm: Convert __do_page_cache_readahead to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This one is trivial. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/readahead.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index f64b31b3a84a..66bcaffd47f0 100

[PATCH v5 21/78] xarray: Add ability to store errno values

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> While the radix tree offers no ability to store IS_ERR pointers, documenting that the XArray does not led to some concern. Here is a sanctioned way to store errnos in the XArray. I'm concerned that it will confuse people who can'

[PATCH v5 08/78] xarray: Define struct xa_node

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a direct replacement for struct radix_tree_node. A couple of struct members have changed name, so convert those. Use a #define so that radix tree users continue to work without change. Signed-off-by: Matthew Wilcox <mawil...@micr

[PATCH v5 64/78] dax: Convert dax_insert_mapping_entry to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 9cfd4fcc0b0d..a3e795ad2493 100644 --- a/fs/dax.c ++

[PATCH v5 58/78] dax: Convert dax_unlock_mapping_entry to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Replace slot_locked() with dax_locked() and inline unlock_slot() into its only caller. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 48 1 file changed, 16 inser

[PATCH v5 72/78] xfs: Convert pag_ici_root to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Rename pag_ici_root to pag_ici_xa and use XArray APIs instead of radix tree APIs. Shorter code, typechecking on tag numbers, better error checking in xfs_reclaim_inode(), and eliminates a call to radix_tree_preload(). Signed-off-by: Matthew

[PATCH v5 45/78] shmem: Convert shmem_tag_pins to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simplify the locking by taking the spinlock while we walk the tree on the assumption that many acquires and releases of the lock will be worse than holding the lock for a (potentially) long time. We could replicate the same locking beh

[PATCH v5 34/78] mm: Convert add_to_swap_cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Combine __add_to_swap_cache and add_to_swap_cache into one function since there is no more need to preload. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/swap_state.c | 93 ++--

[PATCH v5 41/78] pagevec: Use xa_tag_t

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Removes sparse warnings. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/btrfs/extent_io.c| 4 ++-- fs/ext4/inode.c | 2 +- fs/f2fs/data.c | 2 +- fs/gfs2/aops.c | 2 +- include/linux/p

[PATCH v5 74/78] xfs: Convert mru cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This eliminates a call to radix_tree_preload(). Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/xfs/xfs_mru_cache.c | 72 +++--- 1 file changed, 33 insertions(+), 39 deletions(-)

[PATCH v5 33/78] mm: Convert truncate to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is essentially xa_cmpxchg() with the locking handled above us, and it doesn't have to handle replacing a NULL entry. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/truncate.c | 15 ++- 1 file changed,

[PATCH v5 77/78] irqdomain: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> In a non-critical path, irqdomain wants to know how many entries are stored in the xarray, so add xa_count(). This is a pretty straightforward conversion; mostly just removing now-redundant locking. The only thing of note is just how much s

[PATCH v5 40/78] mm: Convert khugepaged_scan_shmem to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Slightly shorter and easier to read code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/khugepaged.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugep

[PATCH v5 17/78] xarray: Add xa_destroy

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This function frees all the internal memory allocated to the xarray and reinitialises it to be empty. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/xarray.h | 1 + lib/xarray.c | 25

[PATCH v5 53/78] fs: Convert buffer to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Mostly comment fixes, but one use of __xa_set_tag. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/buffer.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[PATCH v5 71/78] xfs: Convert m_perag_tree to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Getting rid of the m_perag_lock lets us also get rid of the call to radix_tree_preload(). This is a relatively naive conversion; we could improve performance over the radix tree implementation by passing around xa_state pointers instead of i

[PATCH v5 73/78] xfs: Convert xfs dquot to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a pretty straight-forward conversion. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/xfs/xfs_dquot.c | 38 +- fs/xfs/xfs_qm.c| 32 fs/

[PATCH v5 04/78] page cache: Use xa_lock

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Remove the address_space ->tree_lock and use the xa_lock newly added to the radix_tree_root. Rename the address_space ->page_tree to ->pages, since we don't really care that it's a tree. Take the opportunity to rearran

[PATCH v5 23/78] ida: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the xarray infrstructure like we used the radix tree infrastructure. This lets us get rid of idr_get_free() from the radix tree code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/idr.h| 8 +- i

[PATCH v5 66/78] dax: Fix sparse warning

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> sparse doesn't know that follow_pte_pmd conditionally acquires the ptl, so add an annotation to let it know what's going on. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 1 + 1 file changed, 1 insertion(+) dif

[PATCH v5 61/78] dax: Convert __dax_invalidate_mapping_entry to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Simple now that we already have an xa_state! Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 2629ffa70575..

[PATCH v5 19/78] xarray: Add xas_create_range

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This hopefully temporary function is useful for users who have not yet been converted to multi-index entries. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/xarray.h | 2 ++ lib/xarray.c

[PATCH v5 24/78] page cache: Convert hole search to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The page cache offers the ability to search for a miss in the previous or next N locations. Rather than teach the XArray about the page cache's definition of a miss, use xas_prev() and xas_next() to search the page array. This should b

[PATCH v5 22/78] idr: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The IDR distinguishes between unallocated entries (read as NULL) and entries where the user has chosen to store NULL. The radix tree was modified to consider NULL entries which had tag 0 _clear_ as being allocated, but it added a lot of comp

[PATCH v5 13/78] xarray: Add xa_cmpxchg

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This works like doing cmpxchg() on an array entry. Code which wants the radix_tree_insert() semantic of not overwriting an existing entry can cmpxchg() with NULL and get the action it wants. Plus, instead of having an error returned, th

[PATCH v5 70/78] brd: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Convert brd_pages from a radix tree to an XArray. Simpler and smaller code; in particular another user of radix_tree_preload is eliminated. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- drivers/bloc

[PATCH v5 12/78] xarray: Add xa_store

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> xa_store() differs from radix_tree_insert() in that it will overwrite an existing element in the array rather than returning an error. This is the behaviour which most users want, and those that want more complex behaviour generally want

[PATCH v5 68/78] mm: Convert cgroup writeback to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a fairly naive conversion, leaving in place the GFP_ATOMIC allocation. By switching the locking around, we could use GFP_KERNEL and probably simplify the error handling. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>

[PATCH v5 26/78] page cache: Add and replace pages using the XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Use the XArray APIs to add and replace pages in the page cache. This removes two uses of the radix tree preload API and is significantly shorter code. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/fil

[PATCH v5 32/78] mm: Convert workingset to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> We construct a fake XA_STATE and use it to delete the node with xa_store() rather than adding a special function for this unique use case. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/swap.h | 4 ++-- mm/

[PATCH v5 35/78] mm: Convert delete_from_swap_cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Both callers of __delete_from_swap_cache have the swp_entry_t already, so pass that in to make constructing the XA_STATE easier. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/swap.h | 5 +++-- mm/swap_state

[PATCH v5 56/78] f2fs: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a straightforward conversion. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/f2fs/data.c | 3 +-- fs/f2fs/dir.c| 5 + fs/f2fs/inline.c | 6 +- fs/f2fs/node.c | 10 ++ 4 files changed,

[PATCH v5 54/78] fs: Convert writeback to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> A couple of short loops. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/fs-writeback.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-write

[PATCH v5 62/78] dax: Convert dax_writeback_one to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Likewise easy Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index d3894c15609a..d6dd779e1b46 100644 --- a/fs

[PATCH v5 00/78] XArray v5

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Again, this patch set does not apply to any particular tree because it depends on things which are purely noise, and I'm trying to keep the patch count down [1]. If you want it in a git tree, try http://git.infradead.org/users/willy/linux-d

[PATCH v5 55/78] nilfs2: Convert to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> I'm not 100% convinced that the rewrite of nilfs_copy_back_pages is correct, but it will at least have different bugs from the current version. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/nilfs2/b

[PATCH v5 47/78] shmem: Convert shmem_add_to_page_cache to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This removes the last caller of radix_tree_maybe_preload_order(). Simpler code, unless we run out of memory for new xa_nodes partway through inserting entries into the xarray. Hopefully we can support multi-index entries in the page cach

[PATCH v5 75/78] usb: Convert xhci-mem to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The XArray API is a slightly better fit for xhci_insert_segment_mapping() than the radix tree API was. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- drivers/usb/host/xhci-mem.c | 68 +++---

[PATCH v5 02/78] fscache: Use appropriate radix tree accessors

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Don't open-code accesses to data structure internals. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/fscache/cookie.c | 2 +- fs/fscache/object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v5 31/78] mm: Convert page-writeback to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Includes moving mapping_tagged() to fs.h as a static inline, and changing it to return bool. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/fs.h | 17 +-- mm/page-writ

[PATCH v5 29/78] page cache: Convert delete_batch to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Rename the function from page_cache_tree_delete_batch to just page_cache_delete_batch. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/filemap.c | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-)

[PATCH v5 67/78] page cache: Finish XArray conversion

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> With no more radix tree API users left, we can drop the GFP flags and use xa_init() instead of INIT_RADIX_TREE(). Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/inode.c | 2 +- include/linux/fs.h | 2 +- mm/swap_st

[PATCH v5 59/78] dax: Convert lock_slot to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- fs/dax.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index dd4674ce48f5..46a4d83b1b46 100644 --- a/fs/dax.c ++

[PATCH v5 49/78] shmem: Convert shmem_free_swap to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a perfect use for xa_cmpxchg(). Note the use of 0 for GFP flags; we won't be allocating memory. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/shmem.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-)

[PATCH v5 27/78] page cache: Convert page deletion to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> The code is slightly shorter and simpler. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/filemap.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/mm/filemap.c b/mm/fil

[PATCH v5 20/78] xarray: Add MAINTAINERS entry

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Add myself as XArray and IDR maintainer. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- MAINTAINERS | 12 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 82ad0eabce4f..bb5ffa1

[PATCH v5 25/78] page cache: Add page_cache_range_empty function

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> btrfs has its own custom function for determining whether the page cache has any pages in a particular range. Move this functionality to the page cache, and call it from btrfs. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> -

[PATCH v5 14/78] xarray: Add xa_for_each

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This iterator allows the user to efficiently walk a range of the array, executing the loop body once for each non-NULL entry in that range. This commit also includes xa_find() and xa_next() which are helper functions for xa_for_each() but ma

[PATCH v5 18/78] xarray: Add xas_next and xas_prev

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> These two functions move the xas index by one position, and adjust the rest of the iterator state to match it. This is more efficient than calling xas_set() as it keeps the iterator at the leaves of the tree instead of walking the iterato

[PATCH v5 51/78] shmem: Comment fixups

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Remove the last mentions of radix tree from various comments. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/shmem.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/shmem.c b/mm/s

[PATCH v5 44/78] shmem: Convert find_swap_entry to XArray

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> This is a 1:1 conversion. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/shmem.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 654f367aca90..

[PATCH v5 30/78] page cache: Remove stray radix comment

2017-12-15 Thread Matthew Wilcox
From: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 92ddee25f19b..75d1b32080a4 100644 --- a/mm/filemap.c +++ b/

  1   2   3   4   >