linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Harry (Hyeonggon) Yoo" <42.hyeyoo@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@linux.com>,
	David Rientjes <rientjes@google.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org, Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang1211@gmail.com>,
	rcu@vger.kernel.org
Subject: Re: [PATCH 3/4] rcu, slab: use a regular callback function for kvfree_rcu
Date: Wed, 5 Feb 2025 18:13:37 +0900	[thread overview]
Message-ID: <Z6MrwUgsgX-LK4eY@MacBook-Air-5.local> (raw)
In-Reply-To: <20250203-slub-tiny-kfree_rcu-v1-3-d4428bf9a8a1@suse.cz>

On Mon, Feb 03, 2025 at 10:28:49AM +0100, Vlastimil Babka wrote:
> RCU has been special-casing callback function pointers that are integers
> lower than 4096 as offsets of rcu_head for kvfree() instead. The tree
> RCU implementation no longer does that as the batched kvfree_rcu() is
> not a simple call_rcu(). The tiny RCU still does, and the plan is also
> to make tree RCU use call_rcu() for SLUB_TINY configurations.
> 
> Instead of teaching tree RCU again to special case the offsets, let's
> remove the special casing completely. Since there's no SLOB anymore, it
> is possible to create a callback function that can take a pointer to a
> middle of slab object with unknown offset and determine the object's
> pointer before freeing it, so implement that as kvfree_rcu_cb().
> 
> Large kmalloc and vmalloc allocations are handled simply by aligning
> down to page size. For that we retain the requirement that the offset is
> smaller than 4096. But we can remove __is_kvfree_rcu_offset() completely
> and instead just opencode the condition in the BUILD_BUG_ON() check.
> 
> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>

Looks good to me,
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>

> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

-- 
Harry


  reply	other threads:[~2025-02-05  9:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  9:28 [PATCH 0/4] slab, rcu: move and consolidate TINY_RCU kvfree_rcu() to SLAB Vlastimil Babka
2025-02-03  9:28 ` [PATCH 1/4] slab, rcu: move TINY_RCU variant of " Vlastimil Babka
2025-02-04  9:50   ` Harry (Hyeonggon) Yoo
2025-02-03  9:28 ` [PATCH 2/4] rcu: remove trace_rcu_kvfree_callback Vlastimil Babka
2025-02-05  9:28   ` Harry (Hyeonggon) Yoo
2025-02-03  9:28 ` [PATCH 3/4] rcu, slab: use a regular callback function for kvfree_rcu Vlastimil Babka
2025-02-05  9:13   ` Harry (Hyeonggon) Yoo [this message]
2025-02-03  9:28 ` [PATCH 4/4] slab: don't batch kvfree_rcu() with SLUB_TINY Vlastimil Babka
2025-02-05  9:40   ` Harry (Hyeonggon) Yoo
2025-02-03 19:07 ` [PATCH 0/4] slab, rcu: move and consolidate TINY_RCU kvfree_rcu() to SLAB Paul E. McKenney
2025-02-04 10:02   ` Vlastimil Babka
2025-02-04 11:41     ` Paul E. McKenney
2025-02-05  9:54 ` Vlastimil Babka

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=Z6MrwUgsgX-LK4eY@MacBook-Air-5.local \
    --to=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=boqun.feng@gmail.com \
    --cc=cl@linux.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-mm@kvack.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=rcu@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /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