* + maple_tree-use-kfree_rcu-in-ma_free_rcu.patch added to mm-new branch
@ 2025-07-18 21:15 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-07-18 21:15 UTC (permalink / raw)
To: mm-commits, willy, sidhartha.kumar, liam.howlett, pfalcato, akpm
The patch titled
Subject: maple_tree: use kfree_rcu in ma_free_rcu
has been added to the -mm mm-new branch. Its filename is
maple_tree-use-kfree_rcu-in-ma_free_rcu.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-use-kfree_rcu-in-ma_free_rcu.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
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
maple_tree-use-kfree_rcu-in-ma_free_rcu.patch
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-07-18 21:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18 21:15 + maple_tree-use-kfree_rcu-in-ma_free_rcu.patch added to mm-new branch 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.