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.

tools/testing/radix-tree: test maple tree chaining mas_preallocate() calls

Testing calling multiple mas_preallocate() calls in a row after adjusting
the maple state. Ensures new calls to mas_preallocate() will change the
number of allocated nodes.

Link: https://lkml.kernel.org/r/20250616184521.3382795-4-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Acked-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Hailong Liu <hailong.liu@oppo.com>
Cc: "Liam R. Howlett" <howlett@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
ec3681e8 f687fd5a

+12
+12
tools/testing/radix-tree/maple.c
··· 35669 35669 allocated = mas_allocated(&mas); 35670 35670 height = mas_mt_height(&mas); 35671 35671 MT_BUG_ON(mt, allocated != 0); 35672 + 35673 + /* Chaining multiple preallocations */ 35674 + mt_set_in_rcu(mt); 35675 + mas_set_range(&mas, 800, 805); /* Slot store, should be 0 allocations */ 35676 + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); 35677 + allocated = mas_allocated(&mas); 35678 + MT_BUG_ON(mt, allocated != 0); 35679 + mas.last = 809; /* Node store */ 35680 + MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0); 35681 + allocated = mas_allocated(&mas); 35682 + MT_BUG_ON(mt, allocated != 1); 35683 + mas_store_prealloc(&mas, ptr); 35672 35684 } 35673 35685 /* End of preallocation testing */ 35674 35686