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

maple_tree: testing fix for spanning store on 32b

32 bit nodes have a larger branching factor. This affects the required
value to cause a height change. Update the spanning store height test to
work for both 64 and 32 bit nodes.

Link: https://lkml.kernel.org/r/20250828003023.418966-3-Liam.Howlett@oracle.com
Fixes: f9d3a963fef4 ("maple_tree: use height and depth consistently")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
103e9062 82b5fe30

+6 -1
+6 -1
tools/testing/radix-tree/maple.c
··· 36327 36327 static inline void check_spanning_store_height(struct maple_tree *mt) 36328 36328 { 36329 36329 int index = 0; 36330 + int last = 140; 36330 36331 MA_STATE(mas, mt, 0, 0); 36331 36332 mas_lock(&mas); 36332 36333 while (mt_height(mt) != 3) { 36333 36334 mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL); 36334 36335 mas_set(&mas, ++index); 36335 36336 } 36336 - mas_set_range(&mas, 90, 140); 36337 + 36338 + if (MAPLE_32BIT) 36339 + last = 155; /* 32 bit higher branching factor. */ 36340 + 36341 + mas_set_range(&mas, 90, last); 36337 36342 mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL); 36338 36343 MT_BUG_ON(mt, mas_mt_height(&mas) != 2); 36339 36344 mas_unlock(&mas);