On Mon, May 21, 2018 at 11:20:31PM +0800, Huaisheng Ye wrote:
> @@ -343,7 +343,7 @@ static void destroy_cache(struct zs_pool *pool)
> static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp)
> {
> return (unsigned long)kmem_cache_alloc(pool->handle_cachep,
> -
On Tue, May 22, 2018 at 08:37:28PM +0200, Michal Hocko wrote:
> So why is this any better than the current code. Sure I am not a great
> fan of GFP_ZONE_TABLE because of how it is incomprehensible but this
> doesn't look too much better, yet we are losing a check for incompatible
> gfp flags. The
On Thu, May 24, 2018 at 05:29:43PM +0200, Michal Hocko wrote:
> > ie if we had more,
> > could we solve our pain by making them more generic?
>
> Well, if you have more you will consume more bits in the struct pages,
> right?
Not necessarily ... the zone number is stored in the struct page
On Thu, May 24, 2018 at 02:23:23PM +0200, Michal Hocko wrote:
> > If we had eight ZONEs, we could offer:
>
> No, please no more zones. What we have is quite a maint. burden on its
> own. Ideally we should only have lowmem, highmem and special/device
> zones for directly kernel accessible memory,
On Thu, Jan 18, 2018 at 05:56:12PM +0100, David Sterba wrote:
> On Thu, Jan 18, 2018 at 08:48:43AM -0800, Matthew Wilcox wrote:
> > Thank you! I shall attempt to debug. Was this with a btrfs root
> > filesystem? I'm most suspicious of those patches right now, since they've
&g
On Thu, Jan 18, 2018 at 05:07:50PM +0100, David Sterba wrote:
> On Wed, Jan 17, 2018 at 12:20:24PM -0800, Matthew Wilcox wrote:
> > From: Matthew Wilcox <mawil...@microsoft.com>
> >
> > This version of the XArray has no known bugs.
>
> I've booted this pat
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
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
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
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 9a30224da4d6..b66b8c896ed8 100644
--- a/fs
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
From: Matthew Wilcox <mawil...@microsoft.com>
xa_find() is a slightly easier API to use than
radix_tree_gang_lookup_slot() because it contains its own RCU locking.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
mm/shmem.c | 14 --
1 file changed, 4 inser
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 d3fe61b95216..
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>
From: Matthew Wilcox <mawil...@microsoft.com>
The radix tree of vmap blocks is simpler to express as an XArray.
Saves a couple of hundred bytes of text and eliminates a user of the
radix tree preload API.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
mm/vm
From: Matthew Wilcox <mawil...@microsoft.com>
Instead of calling find_get_pages_range() and putting any reference,
just use xa_find() to look for a page in the right range.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
mm/filemap.c | 9 +
1 file changed, 1 ins
From: Matthew Wilcox <mawil...@microsoft.com>
This is an unusual way to use the xarray tags. If any other users
come up, we can add an xas_get_tags() / xas_set_tags() API, but until
then I don't want to encourage this kind of abuse.
Signed-off-by: Matthew Wilcox <mawil...@micr
From: Matthew Wilcox <mawil...@microsoft.com>
This is a straightforward conversion.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/xen/pvcalls-back.c | 51 ++
1 file changed, 15 insertions(+), 36 deletions(-)
diff --g
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(-)
From: Matthew Wilcox <mawil...@microsoft.com>
Straightforward conversion.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/f2fs/gc.c | 14 +++---
fs/f2fs/gc.h | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2f
From: Matthew Wilcox <mawil...@microsoft.com>
This is a very straightforward conversion. The handling of collisions
in the namecache could be better handled with an hlist, but that's a
patch for another day.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/btrfs
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
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,
From: Matthew Wilcox <mawil...@microsoft.com>
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/staging/lustre/lustre/llite/glimpse.c | 12 +---
drivers/staging/lustre/lustre/mdc/mdc_request.c | 16
2 files changed, 13 insertions(+),
From: Matthew Wilcox <mawil...@microsoft.com>
Eliminate the buffer_lock as the internal xa_lock provides all the
necessary protection. We can remove the radix_tree_preload calls, but
I can't find a good way to use the 'exists' result from xa_cmpxchg().
We could resort to the advanc
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 *.
Initialising the spinlock requires a name for the benefit of lockdep,
so RADIX_TREE_INIT() now needs to know the name of the
From: Matthew Wilcox <mawil...@microsoft.com>
Instead of storing a pointer to the slot containing the canonical entry,
store the offset of the slot. Produces slightly more efficient code
(~300 bytes) and simplifies the implementation.
Signed-off-by: Matthew Wilcox <mawil...@micr
From: Matthew Wilcox <mawil...@microsoft.com>
This version of the XArray has no known bugs. I have converted the
radix tree test suite entirely over to the XArray and fixed all bugs
that it has uncovered. There are additional tests in the test suite for
the XArray, so I now claim the XArr
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
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
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
From: Matthew Wilcox <mawil...@microsoft.com>
I had to mess with the locking a bit as I converted the code from a
mutex to the xa_lock.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/hwspinlock/hwspinlock_core.c | 151 ---
1 file
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
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
From: Matthew Wilcox <mawil...@microsoft.com>
Rename it to just 'delayed_nodes' and remove it from the protection of
btrfs_root->inode_lock.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/btrfs/ctree.h | 8 +++---
fs/btrfs/delay
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 ++--
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 f3463d93a6ce..8eab0b56f7f9 100644
--- a/fs/dax.c
++
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
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
From: Matthew Wilcox <mawil...@microsoft.com>
sparse doesn't know that follow_pte_pmd() conditionally acquires the ptl,
because it's in a separate compilation unit. Move follow_pte_pmd() to
mm.h where sparse can see it.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
i
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
From: Matthew Wilcox <mawil...@microsoft.com>
This time, we want to convert get_unlocked_mapping_entry() to use the
XArray. That has a ripple effect, causing us to change the waitqueues
to hash on the address of the xarray rather than the address of the
mapping (functionally equi
From: Matthew Wilcox <mawil...@microsoft.com>
shmem_radix_tree_replace() is renamed to shmem_xa_replace() and
converted to use the XArray API.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
mm/shmem.c | 22 --
1 file changed, 8 insertions(+),
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
From: Matthew Wilcox <mawil...@microsoft.com>
The radix tree was being protected by a raw spinlock. I believe that
was not necessary, and the new internal regular spinlock will be
adequate for this array.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/sh
From: Matthew Wilcox <mawil...@microsoft.com>
Skip converting the lock to use xa_lock; I think this code can live with
the double-locking.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
block/blk-ioc.c | 13 +++--
include/linux/iocontext.h | 6 +++
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| 36 ++--
fs/
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
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
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
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
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
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
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
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(-)
From: Matthew Wilcox <mawil...@microsoft.com>
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/dax.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b66b8c896ed8..e6b25ef112f2 100644
--- a/fs/dax.c
+++ b/fs/dax.c
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 +++---
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 e6b25ef112f2..494e8fb7a98f 100644
--- a/fs/dax.c
++
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
From: Matthew Wilcox <mawil...@microsoft.com>
This function simply creates a slot in the XArray for users which need
to acquire multiple locks before storing their entry in the tree and
so cannot use a plain xa_store().
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
i
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
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
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 d2a0031d61f5..2536fcacb5bc 100644
--- a/mm/filemap.c
+++ b/
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>
-
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 | 28 +---
1 file changed, 13 insertions(+), 15 deleti
From: Matthew Wilcox <mawil...@microsoft.com>
The code is slightly shorter and simpler.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
mm/filemap.c | 30 ++
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/mm/filemap.c b/mm/fil
From: Matthew Wilcox <mawil...@microsoft.com>
Rename reada_tree to reada_array. Use the xa_lock in reada_array to
replace reada_lock. This has to use a nested spinlock as we take the
xa_lock of the reada_extents and reada_zones xarrays while holding
the reada_lock.
Signed-off-by: M
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>
---
include/linux/swap.h |
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
From: Matthew Wilcox <mawil...@microsoft.com>
Straightforward conversion.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/btrfs/reada.c | 32 +---
fs/btrfs/volumes.c | 2 +-
fs/btrfs/volumes.h | 2 +-
3 files changed, 19 insertions(+),
From: Matthew Wilcox <mawil...@microsoft.com>
I found another victim of the radix tree being hard to use. Because
there was no call to radix_tree_preload(), khugepaged was allocating
radix_tree_nodes using GFP_ATOMIC.
I also converted a local_irq_save()/restore() pair to
disable()/
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
From: Matthew Wilcox <mawil...@microsoft.com>
The use of the reada_lock means we have to use the xa_reserve() API.
If we can avoid using reada_lock to protect this xarray, we can drop
the use of that function.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/btrfs/re
From: Matthew Wilcox <mawil...@microsoft.com>
The reada_lock in struct btrfs_device was only initialised, and not
actually used. That's good because there's another lock also called
reada_lock in the btrfs_fs_info that was quite heavily used. Remove
this one.
Signed-off-by: Matthew
From: Matthew Wilcox <mawil...@microsoft.com>
Most of the gang lookups being done can be expressed just as efficiently
and somewhat more naturally as xa_for_each() loops. I opted not to
change the one in btrfs_cleanup_fs_roots() as it's using SRCU which is
subtle and quick to anger.
Sign
From: Matthew Wilcox <mawil...@microsoft.com>
Moved the kref protection under the xa_lock too.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
net/qrtr/qrtr.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/net/qrtr/qrtr.c b/net
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>
---
From: Matthew Wilcox <mawil...@microsoft.com>
We can probably avoid the call to xa_reserve() by changing the locking,
but I didn't feel confident enough to do that.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/block/nul
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
From: Matthew Wilcox <mawil...@microsoft.com>
This call to radix_tree_preload is awkward. At the point of allocation,
we're under not only a local lock, but also under the queue lock. So we
can't back out, drop the lock and retry the allocation. Replace this
preload call with
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..
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 | 9 -
From: Matthew Wilcox <mawil...@microsoft.com>
The three radix trees in gmap are all converted to the XArray.
This is another case where the multiple locks held mandates the use
of the xa_reserve() API. The gmap_insert_rmap() function is
considerably simplified by using the advanc
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
From: Matthew Wilcox <mawil...@microsoft.com>
Straightforward conversion.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
drivers/gpu/drm/i915/i915_gem.c | 2 +-
drivers/gpu/drm/i915/i915_gem_context.c | 12 +---
drivers/gpu/drm/i915/i915_g
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
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,
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 18994806e441..55ae4c0
From: Matthew Wilcox <mawil...@microsoft.com>
This function combines the functionality of radix_tree_gang_lookup() and
radix_tree_gang_lookup_tagged(). It extracts entries matching the
specified filter into a normal array.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
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
From: Matthew Wilcox <mawil...@microsoft.com>
Like cmpxchg(), xa_cmpxchg will only store to the index if the current
entry matches the old entry. It returns the current entry, which is
usually more useful than the errno returned by radix_tree_insert().
For the users who really onl
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
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 entry in that range that matches
the filter. This commit also includes xa_find() and xa_find_above()
which are helper fun
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
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
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'
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 | 26 +
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
From: Matthew Wilcox <mawil...@microsoft.com>
The XArray API works out rather well for this user.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/f2fs/super.c | 2 --
fs/f2fs/trace.c | 60 -
fs/f2fs/trace.h | 2
From: Matthew Wilcox <mawil...@microsoft.com>
Rename it to extent_array and use the xa_lock in place of the
extent_tree_lock mutex.
Signed-off-by: Matthew Wilcox <mawil...@microsoft.com>
---
fs/f2fs/extent_cache.c | 59 +-
fs
1 - 100 of 154 matches
Mail list logo