* [PATCH 0/2] maple_tree: Fix testing for 32bit compiles
@ 2025-08-28 0:30 Liam R. Howlett
2025-08-28 0:30 ` [PATCH 1/2] maple_tree: Fix testing for 32 bit builds Liam R. Howlett
2025-08-28 0:30 ` [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b Liam R. Howlett
0 siblings, 2 replies; 6+ messages in thread
From: Liam R. Howlett @ 2025-08-28 0:30 UTC (permalink / raw)
To: Andrew Morton
Cc: maple-tree, linux-mm, linux-kernel, sidhartha.kumar,
Liam R. Howlett
The maple tree test suite supports 32bit builds which causes 32bit nodes
and index/last values. Some tests have too large values and must be
skipped while others depend on certain actions causing the tree to be
altered in another measurable way (such as the height decreasing or
increasing).
Two tests were added that broke 32bit testing, either by compile
warnings or failures. These fixes restore the tests to a working order.
Building 32bit version can be done on a 32bit platform, or by using
a command like: BUILD=32 make clean maple
Liam R. Howlett (2):
maple_tree: Fix testing for 32 bit builds
maple_tree: Testing fix for spanning store on 32b
tools/testing/radix-tree/maple.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--
2.47.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] maple_tree: Fix testing for 32 bit builds
2025-08-28 0:30 [PATCH 0/2] maple_tree: Fix testing for 32bit compiles Liam R. Howlett
@ 2025-08-28 0:30 ` Liam R. Howlett
2025-08-28 15:12 ` Sidhartha Kumar
2025-08-28 0:30 ` [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b Liam R. Howlett
1 sibling, 1 reply; 6+ messages in thread
From: Liam R. Howlett @ 2025-08-28 0:30 UTC (permalink / raw)
To: Andrew Morton
Cc: maple-tree, linux-mm, linux-kernel, sidhartha.kumar,
Liam R. Howlett
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
Some tests are invalid on 32bit due to the size of the index and last.
Making those tests depend on the correct build flags stops compile
complaints.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
tools/testing/radix-tree/maple.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
index 172700fb7784d..90a0db45a33c3 100644
--- a/tools/testing/radix-tree/maple.c
+++ b/tools/testing/radix-tree/maple.c
@@ -36428,6 +36428,7 @@ static void check_nomem_writer_race(struct maple_tree *mt)
*/
static inline int check_vma_modification(struct maple_tree *mt)
{
+#if defined(CONFIG_64BIT)
MA_STATE(mas, mt, 0, 0);
mtree_lock(mt);
@@ -36451,6 +36452,8 @@ static inline int check_vma_modification(struct maple_tree *mt)
mas_destroy(&mas);
mtree_unlock(mt);
+#endif
+
return 0;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b
2025-08-28 0:30 [PATCH 0/2] maple_tree: Fix testing for 32bit compiles Liam R. Howlett
2025-08-28 0:30 ` [PATCH 1/2] maple_tree: Fix testing for 32 bit builds Liam R. Howlett
@ 2025-08-28 0:30 ` Liam R. Howlett
2025-08-28 15:25 ` Sidhartha Kumar
1 sibling, 1 reply; 6+ messages in thread
From: Liam R. Howlett @ 2025-08-28 0:30 UTC (permalink / raw)
To: Andrew Morton
Cc: maple-tree, linux-mm, linux-kernel, sidhartha.kumar,
Liam R. Howlett
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.
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
tools/testing/radix-tree/maple.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
index 90a0db45a33c3..05714c22994ea 100644
--- a/tools/testing/radix-tree/maple.c
+++ b/tools/testing/radix-tree/maple.c
@@ -36327,13 +36327,18 @@ extern void test_kmem_cache_bulk(void);
static inline void check_spanning_store_height(struct maple_tree *mt)
{
int index = 0;
+ int last = 140;
MA_STATE(mas, mt, 0, 0);
mas_lock(&mas);
while (mt_height(mt) != 3) {
mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL);
mas_set(&mas, ++index);
}
- mas_set_range(&mas, 90, 140);
+
+ if (MAPLE_32BIT)
+ last = 155; /* 32 bit higher branching factor. */
+
+ mas_set_range(&mas, 90, last);
mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL);
MT_BUG_ON(mt, mas_mt_height(&mas) != 2);
mas_unlock(&mas);
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] maple_tree: Fix testing for 32 bit builds
2025-08-28 0:30 ` [PATCH 1/2] maple_tree: Fix testing for 32 bit builds Liam R. Howlett
@ 2025-08-28 15:12 ` Sidhartha Kumar
2025-08-28 15:29 ` Liam R. Howlett
0 siblings, 1 reply; 6+ messages in thread
From: Sidhartha Kumar @ 2025-08-28 15:12 UTC (permalink / raw)
To: Liam R. Howlett, Andrew Morton; +Cc: maple-tree, linux-mm, linux-kernel
On 8/27/25 8:30 PM, Liam R. Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
>
> Some tests are invalid on 32bit due to the size of the index and last.
> Making those tests depend on the correct build flags stops compile
> complaints.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Should a fixes tag also be added?
Fixes: 5d659bbb52a2 ("maple_tree: introduce mas_wr_store_type()")
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
> tools/testing/radix-tree/maple.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
> index 172700fb7784d..90a0db45a33c3 100644
> --- a/tools/testing/radix-tree/maple.c
> +++ b/tools/testing/radix-tree/maple.c
> @@ -36428,6 +36428,7 @@ static void check_nomem_writer_race(struct maple_tree *mt)
> */
> static inline int check_vma_modification(struct maple_tree *mt)
> {
> +#if defined(CONFIG_64BIT)
> MA_STATE(mas, mt, 0, 0);
>
> mtree_lock(mt);
> @@ -36451,6 +36452,8 @@ static inline int check_vma_modification(struct maple_tree *mt)
>
> mas_destroy(&mas);
> mtree_unlock(mt);
> +#endif
> +
> return 0;
> }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b
2025-08-28 0:30 ` [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b Liam R. Howlett
@ 2025-08-28 15:25 ` Sidhartha Kumar
0 siblings, 0 replies; 6+ messages in thread
From: Sidhartha Kumar @ 2025-08-28 15:25 UTC (permalink / raw)
To: Liam R. Howlett, Andrew Morton; +Cc: maple-tree, linux-mm, linux-kernel
On 8/27/25 8:30 PM, Liam R. Howlett wrote:
> 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.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Fixes: f9d3a963fef4 ("maple_tree: use height and depth consistently")
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>> ---
> tools/testing/radix-tree/maple.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
> index 90a0db45a33c3..05714c22994ea 100644
> --- a/tools/testing/radix-tree/maple.c
> +++ b/tools/testing/radix-tree/maple.c
> @@ -36327,13 +36327,18 @@ extern void test_kmem_cache_bulk(void);
> static inline void check_spanning_store_height(struct maple_tree *mt)
> {
> int index = 0;
> + int last = 140;
> MA_STATE(mas, mt, 0, 0);
> mas_lock(&mas);
> while (mt_height(mt) != 3) {
> mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL);
> mas_set(&mas, ++index);
> }
> - mas_set_range(&mas, 90, 140);
> +
> + if (MAPLE_32BIT)
> + last = 155; /* 32 bit higher branching factor. */
> +
> + mas_set_range(&mas, 90, last);
> mas_store_gfp(&mas, xa_mk_value(index), GFP_KERNEL);
> MT_BUG_ON(mt, mas_mt_height(&mas) != 2);
> mas_unlock(&mas);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] maple_tree: Fix testing for 32 bit builds
2025-08-28 15:12 ` Sidhartha Kumar
@ 2025-08-28 15:29 ` Liam R. Howlett
0 siblings, 0 replies; 6+ messages in thread
From: Liam R. Howlett @ 2025-08-28 15:29 UTC (permalink / raw)
To: Sidhartha Kumar; +Cc: Andrew Morton, maple-tree, linux-mm, linux-kernel
* Sidhartha Kumar <sidhartha.kumar@oracle.com> [250828 11:12]:
> On 8/27/25 8:30 PM, Liam R. Howlett wrote:
> > From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
> >
> > Some tests are invalid on 32bit due to the size of the index and last.
> > Making those tests depend on the correct build flags stops compile
> > complaints.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Should a fixes tag also be added?
Well, it's a test fix, so there really isn't an issue with the actual
code.. and it's for 32bit.
I don't think we need it backported, but I guess the tag doesn't hurt.
Thanks!
>
> Fixes: 5d659bbb52a2 ("maple_tree: introduce mas_wr_store_type()")
>
> Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
>
> > ---
> > tools/testing/radix-tree/maple.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
> > index 172700fb7784d..90a0db45a33c3 100644
> > --- a/tools/testing/radix-tree/maple.c
> > +++ b/tools/testing/radix-tree/maple.c
> > @@ -36428,6 +36428,7 @@ static void check_nomem_writer_race(struct maple_tree *mt)
> > */
> > static inline int check_vma_modification(struct maple_tree *mt)
> > {
> > +#if defined(CONFIG_64BIT)
> > MA_STATE(mas, mt, 0, 0);
> > mtree_lock(mt);
> > @@ -36451,6 +36452,8 @@ static inline int check_vma_modification(struct maple_tree *mt)
> > mas_destroy(&mas);
> > mtree_unlock(mt);
> > +#endif
> > +
> > return 0;
> > }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-28 15:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 0:30 [PATCH 0/2] maple_tree: Fix testing for 32bit compiles Liam R. Howlett
2025-08-28 0:30 ` [PATCH 1/2] maple_tree: Fix testing for 32 bit builds Liam R. Howlett
2025-08-28 15:12 ` Sidhartha Kumar
2025-08-28 15:29 ` Liam R. Howlett
2025-08-28 0:30 ` [PATCH 2/2] maple_tree: Testing fix for spanning store on 32b Liam R. Howlett
2025-08-28 15:25 ` Sidhartha Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).