Skip to contentSkip to conversation

maple_tree-add-rcu-locking-check-when-lockdep-is-enabled.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 25

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: maple_tree: add rcu locking check when LOCKDEP is enabled
has been removed from the -mm tree. Its filename was
maple_tree-add-rcu-locking-check-when-lockdep-is-enabled.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Liam R. Howlett (Oracle)" <[email protected]>
Subject: maple_tree: add rcu locking check when LOCKDEP is enabled
Date: Fri, 21 Aug 2026 15:26:09 -0400

Patch series "maple_tree: lock checking and clean ups", v3.

In this series:
1. Try to detect lock issues
A number of syzbot reports are incorrectly pointing to the mm exit as a source of the locking error. The first three patches attempt to help users detect errors in their locking - but they still have to use LOCKDEP. I guess it's still down to hope and prayers.

2. Documentation fixes
The documentation was lacking clarity, there are updates to try and help the users, especially around the erase() cases.

3. Two benign issues
The cyclic allocator may have a race, although no in-kernel user can hit it.
The erase functions may cause allocation issues if used with the incorrect locking type, but none are present in-tree.

4. The erase gfp uses
mas_erase() and mtree_erase() do not take a gfp argument. To improve reliability of the erase, the first attempt to allocate will be GFP_NOWAIT, followed by a retry (if necessary of GFP_KERNEL | GFP_NOFAIL. This will ensure the data is gone. I've updated the documentation to make it more clear as well. mas_store() is not addressed in the same way, but may need to be updated at a later date, but that may require changing callers so it is out of scope here.

Beyond these goals there are some test fixes, some general speed-up patches targeting extra work and cycles, and dropping dead code.

This patch (of 19):

When CONFIG_LOCKDEP and CONFIG_RCU_STRICT_GRACE_PERIOD is enabled, check for rcu locking issues by recording the grace period in the maple state and checking the rcu window is still valid whenever the maple state is reused with a state that is not MA_START or MA_PAUSED.

---

 include/linux/maple_tree.h |    3 ++
 lib/maple_tree.c           |   50 ++++++++++++++++++++++++++++++++++-
 2 files changed, 52 insertions(+), 1 deletion(-)
include/linux/maple_tree.h renamed from include/linux/maple_tree.h~maple_tree-add-rcu-locking-check-when-lockdep-is-enabled +3 -0
@@ -484,6 +484,9 @@ struct ma_state {
 	unsigned char mas_flags;
 	unsigned char end;		/* The end of the node */
 	enum store_type store_type;	/* The type of store needed for this operation */
+#if IS_ENABLED(CONFIG_LOCKDEP) && IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD)
+	unsigned long rcu_gp;
+#endif
 };
 
 struct ma_wr_state {
lib/maple_tree.c renamed from lib/maple_tree.c~maple_tree-add-rcu-locking-check-when-lockdep-is-enabled +49 -1

134 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are