[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250616184521.3382795-4-Liam.Howlett@oracle.com>
Date: Mon, 16 Jun 2025 14:45:21 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, stable@...nel.org,
Suren Baghdasaryan <surenb@...gle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Hailong Liu <hailong.liu@...o.com>, zhangpeng.00@...edance.com,
Steve Kang <Steve.Kang@...soc.com>,
Matthew Wilcox <willy@...radead.org>,
Sidhartha Kumar <sidhartha.kumar@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Subject: [PATCH 3/3] 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.
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
tools/testing/radix-tree/maple.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c
index 6a5b0342941c4..49e89dfad950c 100644
--- a/tools/testing/radix-tree/maple.c
+++ b/tools/testing/radix-tree/maple.c
@@ -35693,6 +35693,18 @@ static noinline void __init check_prealloc(struct maple_tree *mt)
allocated = mas_allocated(&mas);
height = mas_mt_height(&mas);
MT_BUG_ON(mt, allocated != 0);
+
+ /* Chaining multiple preallocations */
+ mt_set_in_rcu(mt);
+ mas_set_range(&mas, 800, 805); /* Slot store, should be 0 allocations */
+ MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0);
+ allocated = mas_allocated(&mas);
+ MT_BUG_ON(mt, allocated != 0);
+ mas.last = 809; /* Node store */
+ MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL) != 0);
+ allocated = mas_allocated(&mas);
+ MT_BUG_ON(mt, allocated != 1);
+ mas_store_prealloc(&mas, ptr);
}
/* End of preallocation testing */
--
2.47.2
Powered by blists - more mailing lists