linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pedro Falcato <pfalcato@suse.de>
To: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	 maple-tree@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] maple_tree: Use kfree_rcu in ma_free_rcu
Date: Wed, 6 Aug 2025 11:20:19 +0100	[thread overview]
Message-ID: <tbm6emntje2lcwmg5xa6whlhsghwflbyb6p7m4y72dffenttqz@g2hftzczixxx> (raw)
In-Reply-To: <l7kladnev3bfxcg2n2rk6hdi757vro5warlwp44ripj3qmnsfr@2jlwi7hhsfot>

On Tue, Aug 05, 2025 at 09:25:13PM -0400, Liam R. Howlett wrote:
> * Pedro Falcato <pfalcato@suse.de> [250718 13:21]:
> > 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.
> [snip]
> >  static void mt_set_height(struct maple_tree *mt, unsigned char height)
> > @@ -5281,7 +5274,7 @@ static void mt_free_walk(struct rcu_head *head)
> >  	mt_free_bulk(node->slot_len, slots);
> >  
> >  free_leaf:
> > -	mt_free_rcu(&node->rcu);
> > +	mt_free_one(node);
> 
> Why are we still using mt_free_one()?  Couldn't this also be dropped in
> favour of kfree() or does kfree() not work for kmem_cache?

kfree() also works (since SLOB was dropped). I thought you wanted mt_free_one
for style points, but I can replace all calls with a direct kfree() if you prefer.

-- 
Pedro


      reply	other threads:[~2025-08-06 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 17:21 Pedro Falcato
2025-07-18 17:21 ` [PATCH 2/2] testing/radix-tree/maple: Hack around kfree_rcu not existing Pedro Falcato
2025-07-18 18:05   ` Sidhartha Kumar
2025-08-06  1:26   ` Liam R. Howlett
2025-08-06 10:21     ` Pedro Falcato
2025-08-10 14:23   ` Lorenzo Stoakes
2025-08-06  1:25 ` [PATCH 1/2] maple_tree: Use kfree_rcu in ma_free_rcu Liam R. Howlett
2025-08-06 10:20   ` Pedro Falcato [this message]

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=tbm6emntje2lcwmg5xa6whlhsghwflbyb6p7m4y72dffenttqz@g2hftzczixxx \
    --to=pfalcato@suse.de \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox