From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,willy@infradead.org,sidhartha.kumar@oracle.com,liam.howlett@oracle.com,pfalcato@suse.de,akpm@linux-foundation.org
Subject: + maple_tree-use-kfree_rcu-in-ma_free_rcu.patch added to mm-new branch
Date: Fri, 18 Jul 2025 14:15:42 -0700 [thread overview]
Message-ID: <20250718211542.ABE27C4CEEB@smtp.kernel.org> (raw)
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
reply other threads:[~2025-07-18 21:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250718211542.ABE27C4CEEB@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=liam.howlett@oracle.com \
--cc=mm-commits@vger.kernel.org \
--cc=pfalcato@suse.de \
--cc=sidhartha.kumar@oracle.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.