* [to-be-updated] maple_tree-add-a-test-case-to-check-maple_alloc.patch removed from -mm tree
@ 2023-04-11 3:55 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-04-11 3:55 UTC (permalink / raw)
To: mm-commits, Liam.Howlett, zhangpeng.00, akpm
The quilt patch titled
Subject: maple_tree: add a test case to check maple_alloc
has been removed from the -mm tree. Its filename was
maple_tree-add-a-test-case-to-check-maple_alloc.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Peng Zhang <zhangpeng.00@bytedance.com>
Subject: maple_tree: add a test case to check maple_alloc
Date: Fri, 7 Apr 2023 12:07:17 +0800
Add a test case to check whether the number of maple_alloc structures is
actually equal to mas->alloc->total.
Link: https://lkml.kernel.org/r/20230407040718.99064-1-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/radix-tree/maple.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--- a/tools/testing/radix-tree/maple.c~maple_tree-add-a-test-case-to-check-maple_alloc
+++ a/tools/testing/radix-tree/maple.c
@@ -55,6 +55,28 @@ struct rcu_reader_struct {
struct rcu_test_struct2 *test;
};
+static int get_alloc_node_count(struct ma_state *mas)
+{
+ int count = 1;
+ struct maple_alloc *node = mas->alloc;
+
+ if (!node || ((unsigned long)node & 0x1))
+ return 0;
+ while (node->node_count) {
+ count += node->node_count;
+ node = node->slot[0];
+ }
+ return count;
+}
+
+static void check_mas_alloc_node_count(struct ma_state *mas)
+{
+ mas_node_count_gfp(mas, MAPLE_ALLOC_SLOTS + 1, GFP_KERNEL);
+ mas_node_count_gfp(mas, MAPLE_ALLOC_SLOTS + 3, GFP_KERNEL);
+ MT_BUG_ON(mas->tree, get_alloc_node_count(mas) != mas->alloc->total);
+ mas_destroy(mas);
+}
+
/*
* check_new_node() - Check the creation of new nodes and error path
* verification.
@@ -69,6 +91,8 @@ static noinline void check_new_node(stru
MA_STATE(mas, mt, 0, 0);
+ check_mas_alloc_node_count(&mas);
+
/* Try allocating 3 nodes */
mtree_lock(mt);
mt_set_non_kernel(0);
_
Patches currently in -mm which might be from zhangpeng.00@bytedance.com are
maple_tree-use-correct-variable-type-in-sizeof.patch
mm-kfence-improve-the-performance-of-__kfence_alloc-and-__kfence_free.patch
maple_tree-simplify-mas_wr_node_walk.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-11 3:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11 3:55 [to-be-updated] maple_tree-add-a-test-case-to-check-maple_alloc.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.