From: "Paul E. McKenney" <paulmck@kernel.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@linux.com>,
David Rientjes <rientjes@google.com>,
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>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
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 0/4] slab, rcu: move and consolidate TINY_RCU kvfree_rcu() to SLAB
Date: Tue, 4 Feb 2025 03:41:12 -0800 [thread overview]
Message-ID: <65af727a-55d9-43fd-a6b8-d6d4ef5fbca6@paulmck-laptop> (raw)
In-Reply-To: <4fdbb91c-df21-4dab-a165-a4e864625628@suse.cz>
On Tue, Feb 04, 2025 at 11:02:47AM +0100, Vlastimil Babka wrote:
> On 2/3/25 20:07, Paul E. McKenney wrote:
> > On Mon, Feb 03, 2025 at 10:28:46AM +0100, Vlastimil Babka wrote:
> >> Following the move of the TREE_RCU batching kvfree_rcu() implementation
> >> to slab, we still have the simple non-batching implementation in tiny
> >> RCU, and RCU implementation specific ifdefs in slab code.
> >>
> >> Finish the move and integration into slab. Allow using the simple
> >> call_rcu() based implementation also with tree RCU when SLUB_TINY is
> >> enabled, as its goal is also to limit memory footprint with less concern
> >> for top performance.
> >>
> >> In order to avoid RCU having to recognize the fake callback function
> >> pointers (__is_kvfree_rcu_offset()) when handling call_rcu(), implement
> >> a callback that can calculate the object's address from the embedded
> >> rcu_head pointer without knowing the specific offset (previously SLOB
> >> would not have made it possible, but it's gone now).
> >>
> >> After this series, AFAIK only the following kvfree_rcu specific code
> >> remains in RCU:
> >>
> >> - a call to kfree_rcu_scheduler_running() from rcu_set_runtime_mode()
> >>
> >> - probably necessary and a generic registration interface would be
> >> unnecessary bloat?
> >
> > I am OK with this calling directly.
> >
> > Alternatively, you could create a core_initcall() that did nothing
> > but invoke kfree_rcu_scheduler_running(), and then drop that call from
> > rcu_set_runtime_mode(). Up to you guys!
>
> I was afraid there's some ordering necessary with the rest of what
> rcu_set_runtime_mode() does, but perhaps there's actually not.
I *think* that they are independent, but I agree that it would be good
to carefully double-check.
The basis for my belief is that it is OK to invoke call_rcu() long
before rcu_init() is invoked, let alone the scheduler being ready.
Thanx, Paul
> >> - declarations of kfree_rcu() API in include/linux/rcupdate.h
> >>
> >> - could be moved to slab.h after checking for/fixing up potential
> >> missing includes
> >
> > It would be good to move them, but no real hurry from this end.
> >
> >> git tree:
> >> https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=b4/slub-tiny-kfree_rcu
> >>
> >> Changes since RFC [1]:
> >> - Rebased to v6.14-rc1
> >> - Fixed build errors reported by bots.
> >> - Changed where kvfree_call_rcu() is moved to in patch 1 to avoid another
> >> move in patch 4.
> >> - R-b's by Ulad and Joel
> >> - Fix a memory leak in kvfree_rcu_list() thanks to Ulad
> >> - Various comments' improvements and fixes (Joel, Ulad)
> >> - Rename config to CONFIG_KFREE_RCU_BATCHED (Ulad)
> >>
> >> Due to changes, didn't keep Paul's Tested-by (but thanks!)
> >
> > I re-ran the tests, so feel free to add it back in. ;-)
>
> Thanks, will do :)
>
>
next prev parent reply other threads:[~2025-02-04 11:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 9:28 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
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 [this message]
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=65af727a-55d9-43fd-a6b8-d6d4ef5fbca6@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=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=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