All of lore.kernel.org
 help / color / mirror / Atom feed
* [obsolete] maple_tree-use-kfree_rcu-in-ma_free_rcu.patch removed from -mm tree
@ 2025-08-16  5:56 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-08-16  5:56 UTC (permalink / raw)
  To: mm-commits, willy, sidhartha.kumar, liam.howlett, pfalcato, akpm


The quilt patch titled
     Subject: maple_tree: use kfree_rcu in ma_free_rcu
has been removed from the -mm tree.  Its filename was
     maple_tree-use-kfree_rcu-in-ma_free_rcu.patch

This patch was dropped because it is obsolete

------------------------------------------------------
From: Pedro Falcato <pfalcato@suse.de>
Subject: maple_tree: use kfree_rcu in ma_free_rcu
Date: Fri, 18 Jul 2025 18:21:36 +0100

kfree_rcu is an optimized version of call_rcu + kfree.  It used to not be
possible to call it on non-kmalloc objects, but this restriction was
lifted ever since SLOB was dropped from the kernel, and since commit
6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from
kmem_cache_destroy()").

Thus, replace call_rcu + mt_free_rcu with kfree_rcu.

Link: https://lkml.kernel.org/r/20250718172138.103116-1-pfalcato@suse.de
Signed-off-by: Pedro Falcato <pfalcato@suse.de>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/maple_tree.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

--- a/lib/maple_tree.c~maple_tree-use-kfree_rcu-in-ma_free_rcu
+++ a/lib/maple_tree.c
@@ -191,13 +191,6 @@ static inline void mt_free_bulk(size_t s
 	kmem_cache_free_bulk(maple_node_cache, size, (void **)nodes);
 }
 
-static void mt_free_rcu(struct rcu_head *head)
-{
-	struct maple_node *node = container_of(head, struct maple_node, rcu);
-
-	kmem_cache_free(maple_node_cache, node);
-}
-
 /*
  * ma_free_rcu() - Use rcu callback to free a maple node
  * @node: The node to free
@@ -208,7 +201,7 @@ static void mt_free_rcu(struct rcu_head
 static void ma_free_rcu(struct maple_node *node)
 {
 	WARN_ON(node->parent != ma_parent_ptr(node));
-	call_rcu(&node->rcu, mt_free_rcu);
+	kfree_rcu(node, rcu);
 }
 
 static void mt_set_height(struct maple_tree *mt, unsigned char height)
@@ -5281,7 +5274,7 @@ static void mt_free_walk(struct rcu_head
 	mt_free_bulk(node->slot_len, slots);
 
 free_leaf:
-	mt_free_rcu(&node->rcu);
+	mt_free_one(node);
 }
 
 static inline void __rcu **mte_destroy_descend(struct maple_enode **enode,
@@ -5365,7 +5358,7 @@ next:
 
 free_leaf:
 	if (free)
-		mt_free_rcu(&node->rcu);
+		mt_free_one(node);
 	else
 		mt_clear_meta(mt, node, node->type);
 }
_

Patches currently in -mm which might be from pfalcato@suse.de are

testing-radix-tree-maple-hack-around-kfree_rcu-not-existing.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-16  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-16  5:56 [obsolete] maple_tree-use-kfree_rcu-in-ma_free_rcu.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.