Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

maple_tree: add gap support, slot and pivot sizes for maple copy

Add plumbing work for using maple copy as a normal node for a source of
copy operations. This is needed later.

Link: https://lkml.kernel.org/r/20260130205935.2559335-17-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Kujau <lists@nerdbynature.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
20b20162 de7f3ed3

+6
+1
include/linux/maple_tree.h
··· 165 165 } src[4]; 166 166 /* Simulated node */ 167 167 void __rcu *slot[3]; 168 + unsigned long gap[3]; 168 169 unsigned long min; 169 170 union { 170 171 unsigned long pivot[3];
+5
lib/maple_tree.c
··· 101 101 [maple_leaf_64] = ULONG_MAX, 102 102 [maple_range_64] = ULONG_MAX, 103 103 [maple_arange_64] = ULONG_MAX, 104 + [maple_copy] = ULONG_MAX, 104 105 }; 105 106 #define mt_node_max(x) mt_max[mte_node_type(x)] 106 107 #endif ··· 111 110 [maple_leaf_64] = MAPLE_RANGE64_SLOTS, 112 111 [maple_range_64] = MAPLE_RANGE64_SLOTS, 113 112 [maple_arange_64] = MAPLE_ARANGE64_SLOTS, 113 + [maple_copy] = 3, 114 114 }; 115 115 #define mt_slot_count(x) mt_slots[mte_node_type(x)] 116 116 ··· 120 118 [maple_leaf_64] = MAPLE_RANGE64_SLOTS - 1, 121 119 [maple_range_64] = MAPLE_RANGE64_SLOTS - 1, 122 120 [maple_arange_64] = MAPLE_ARANGE64_SLOTS - 1, 121 + [maple_copy] = 3, 123 122 }; 124 123 #define mt_pivot_count(x) mt_pivots[mte_node_type(x)] 125 124 ··· 129 126 [maple_leaf_64] = (MAPLE_RANGE64_SLOTS / 2) - 2, 130 127 [maple_range_64] = (MAPLE_RANGE64_SLOTS / 2) - 2, 131 128 [maple_arange_64] = (MAPLE_ARANGE64_SLOTS / 2) - 1, 129 + [maple_copy] = 1, /* Should never be used */ 132 130 }; 133 131 #define mt_min_slot_count(x) mt_min_slots[mte_node_type(x)] 134 132 ··· 631 627 case maple_arange_64: 632 628 return node->ma64.gap; 633 629 case maple_copy: 630 + return node->cp.gap; 634 631 case maple_range_64: 635 632 case maple_leaf_64: 636 633 case maple_dense: