Skip to content

Commit dad4f14

Browse files
committed
Merge branch 'xarray' of git://git.infradead.org/users/willy/linux-dax
Pull XArray conversion from Matthew Wilcox: "The XArray provides an improved interface to the radix tree data structure, providing locking as part of the API, specifying GFP flags at allocation time, eliminating preloading, less re-walking the tree, more efficient iterations and not exposing RCU-protected pointers to its users. This patch set 1. Introduces the XArray implementation 2. Converts the pagecache to use it 3. Converts memremap to use it The page cache is the most complex and important user of the radix tree, so converting it was most important. Converting the memremap code removes the only other user of the multiorder code, which allows us to remove the radix tree code that supported it. I have 40+ followup patches to convert many other users of the radix tree over to the XArray, but I'd like to get this part in first. The other conversions haven't been in linux-next and aren't suitable for applying yet, but you can see them in the xarray-conv branch if you're interested" * 'xarray' of git://git.infradead.org/users/willy/linux-dax: (90 commits) radix tree: Remove multiorder support radix tree test: Convert multiorder tests to XArray radix tree tests: Convert item_delete_rcu to XArray radix tree tests: Convert item_kill_tree to XArray radix tree tests: Move item_insert_order radix tree test suite: Remove multiorder benchmarking radix tree test suite: Remove __item_insert memremap: Convert to XArray xarray: Add range store functionality xarray: Move multiorder_check to in-kernel tests xarray: Move multiorder_shrink to kernel tests xarray: Move multiorder account test in-kernel radix tree test suite: Convert iteration test to XArray radix tree test suite: Convert tag_tagged_items to XArray radix tree: Remove radix_tree_clear_tags radix tree: Remove radix_tree_maybe_preload_order radix tree: Remove split/join code radix tree: Remove radix_tree_update_node_t page cache: Finish XArray conversion dax: Convert page fault handlers to XArray ...
2 parents 69d5b97 + 3a08cd5 commit dad4f14

93 files changed

Lines changed: 7052 additions & 3821 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.clang-format‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ ForEachMacros:
323323
- 'protocol_for_each_card'
324324
- 'protocol_for_each_dev'
325325
- 'queue_for_each_hw_ctx'
326-
- 'radix_tree_for_each_contig'
327326
- 'radix_tree_for_each_slot'
328327
- 'radix_tree_for_each_tagged'
329328
- 'rbtree_postorder_for_each_entry_safe'

‎.mailmap‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ Mark Brown <broonie@sirena.org.uk>
119119
Mark Yao <markyao0591@gmail.com> <mark.yao@rock-chips.com>
120120
Martin Kepplinger <martink@posteo.de> <martin.kepplinger@theobroma-systems.com>
121121
Martin Kepplinger <martink@posteo.de> <martin.kepplinger@ginzinger.com>
122+
Matthew Wilcox <willy@infradead.org> <matthew.r.wilcox@intel.com>
123+
Matthew Wilcox <willy@infradead.org> <matthew@wil.cx>
124+
Matthew Wilcox <willy@infradead.org> <mawilcox@linuxonhyperv.com>
125+
Matthew Wilcox <willy@infradead.org> <mawilcox@microsoft.com>
126+
Matthew Wilcox <willy@infradead.org> <willy@debian.org>
127+
Matthew Wilcox <willy@infradead.org> <willy@linux.intel.com>
128+
Matthew Wilcox <willy@infradead.org> <willy@parisc-linux.org>
122129
Matthieu CASTET <castet.matthieu@free.fr>
123130
Mauro Carvalho Chehab <mchehab@kernel.org> <mchehab@brturbo.com.br>
124131
Mauro Carvalho Chehab <mchehab@kernel.org> <maurochehab@gmail.com>

‎Documentation/core-api/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Core utilities
2121
local_ops
2222
workqueue
2323
genericirq
24+
xarray
2425
flexible-arrays
2526
librs
2627
genalloc

‎Documentation/core-api/xarray.rst‎

Lines changed: 435 additions & 0 deletions
Large diffs are not rendered by default.

‎MAINTAINERS‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ F: Documentation/hwmon/adt7475
535535
F: drivers/hwmon/adt7475.c
536536

537537
ADVANSYS SCSI DRIVER
538-
M: Matthew Wilcox <matthew@wil.cx>
538+
M: Matthew Wilcox <willy@infradead.org>
539539
M: Hannes Reinecke <hare@suse.com>
540540
L: linux-scsi@vger.kernel.org
541541
S: Maintained
@@ -4393,7 +4393,7 @@ S: Maintained
43934393
F: drivers/i2c/busses/i2c-diolan-u2c.c
43944394

43954395
FILESYSTEM DIRECT ACCESS (DAX)
4396-
M: Matthew Wilcox <mawilcox@microsoft.com>
4396+
M: Matthew Wilcox <willy@infradead.org>
43974397
M: Ross Zwisler <zwisler@kernel.org>
43984398
M: Jan Kara <jack@suse.cz>
43994399
L: linux-fsdevel@vger.kernel.org
@@ -8697,7 +8697,7 @@ F: drivers/message/fusion/
86978697
F: drivers/scsi/mpt3sas/
86988698

86998699
LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
8700-
M: Matthew Wilcox <matthew@wil.cx>
8700+
M: Matthew Wilcox <willy@infradead.org>
87018701
L: linux-scsi@vger.kernel.org
87028702
S: Maintained
87038703
F: drivers/scsi/sym53c8xx_2/
@@ -16137,6 +16137,17 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
1613716137
S: Maintained
1613816138
F: arch/x86/entry/vdso/
1613916139

16140+
XARRAY
16141+
M: Matthew Wilcox <willy@infradead.org>
16142+
L: linux-fsdevel@vger.kernel.org
16143+
S: Supported
16144+
F: Documentation/core-api/xarray.rst
16145+
F: lib/idr.c
16146+
F: lib/xarray.c
16147+
F: include/linux/idr.h
16148+
F: include/linux/xarray.h
16149+
F: tools/testing/radix-tree
16150+
1614016151
XC2028/3028 TUNER DRIVER
1614116152
M: Mauro Carvalho Chehab <mchehab@kernel.org>
1614216153
L: linux-media@vger.kernel.org

‎arch/parisc/kernel/syscall.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Linux/PA-RISC Project (http://www.parisc-linux.org/)
33
*
44
* System call entry code / Linux gateway page
5-
* Copyright (c) Matthew Wilcox 1999 <willy@bofh.ai>
5+
* Copyright (c) Matthew Wilcox 1999 <willy@infradead.org>
66
* Licensed under the GNU GPL.
77
* thanks to Philipp Rumpf, Mike Shaver and various others
88
* sorry about the wall, puffin..

‎arch/powerpc/include/asm/book3s/64/pgtable.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
716716
BUILD_BUG_ON(_PAGE_HPTEFLAGS & (0x1f << _PAGE_BIT_SWAP_TYPE)); \
717717
BUILD_BUG_ON(_PAGE_HPTEFLAGS & _PAGE_SWP_SOFT_DIRTY); \
718718
} while (0)
719-
/*
720-
* on pte we don't need handle RADIX_TREE_EXCEPTIONAL_SHIFT;
721-
*/
719+
722720
#define SWP_TYPE_BITS 5
723721
#define __swp_type(x) (((x).val >> _PAGE_BIT_SWAP_TYPE) \
724722
& ((1UL << SWP_TYPE_BITS) - 1))

‎arch/powerpc/include/asm/nohash/64/pgtable.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
350350
#define MAX_SWAPFILES_CHECK() do { \
351351
BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS); \
352352
} while (0)
353-
/*
354-
* on pte we don't need handle RADIX_TREE_EXCEPTIONAL_SHIFT;
355-
*/
353+
356354
#define SWP_TYPE_BITS 5
357355
#define __swp_type(x) (((x).val >> _PAGE_BIT_SWAP_TYPE) \
358356
& ((1UL << SWP_TYPE_BITS) - 1))

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5996,7 +5996,8 @@ i915_gem_object_get_sg(struct drm_i915_gem_object *obj,
59965996
count = __sg_page_count(sg);
59975997

59985998
while (idx + count <= n) {
5999-
unsigned long exception, i;
5999+
void *entry;
6000+
unsigned long i;
60006001
int ret;
60016002

60026003
/* If we cannot allocate and insert this entry, or the
@@ -6011,12 +6012,9 @@ i915_gem_object_get_sg(struct drm_i915_gem_object *obj,
60116012
if (ret && ret != -EEXIST)
60126013
goto scan;
60136014

6014-
exception =
6015-
RADIX_TREE_EXCEPTIONAL_ENTRY |
6016-
idx << RADIX_TREE_EXCEPTIONAL_SHIFT;
6015+
entry = xa_mk_value(idx);
60176016
for (i = 1; i < count; i++) {
6018-
ret = radix_tree_insert(&iter->radix, idx + i,
6019-
(void *)exception);
6017+
ret = radix_tree_insert(&iter->radix, idx + i, entry);
60206018
if (ret && ret != -EEXIST)
60216019
goto scan;
60226020
}
@@ -6054,15 +6052,14 @@ i915_gem_object_get_sg(struct drm_i915_gem_object *obj,
60546052
GEM_BUG_ON(!sg);
60556053

60566054
/* If this index is in the middle of multi-page sg entry,
6057-
* the radixtree will contain an exceptional entry that points
6055+
* the radix tree will contain a value entry that points
60586056
* to the start of that range. We will return the pointer to
60596057
* the base page and the offset of this page within the
60606058
* sg entry's range.
60616059
*/
60626060
*offset = 0;
6063-
if (unlikely(radix_tree_exception(sg))) {
6064-
unsigned long base =
6065-
(unsigned long)sg >> RADIX_TREE_EXCEPTIONAL_SHIFT;
6061+
if (unlikely(xa_is_value(sg))) {
6062+
unsigned long base = xa_to_value(sg);
60666063

60676064
sg = radix_tree_lookup(&iter->radix, base);
60686065
GEM_BUG_ON(!sg);

‎drivers/input/keyboard/hilkbd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* linux/drivers/hil/hilkbd.c
33
*
44
* Copyright (C) 1998 Philip Blundell <philb@gnu.org>
5-
* Copyright (C) 1999 Matthew Wilcox <willy@bofh.ai>
5+
* Copyright (C) 1999 Matthew Wilcox <willy@infradead.org>
66
* Copyright (C) 1999-2007 Helge Deller <deller@gmx.de>
77
*
88
* Very basic HP Human Interface Loop (HIL) driver.

0 commit comments

Comments
 (0)