From: Uladzislau Rezki <urezki@gmail.com>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Uladzislau Rezki <urezki@gmail.com>,
Suren Baghdasaryan <surenb@google.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Christoph Lameter <cl@linux.com>,
David Rientjes <rientjes@google.com>,
Pekka Enberg <penberg@kernel.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
Boqun Feng <boqun.feng@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
rcu@vger.kernel.org, maple-tree@lists.infradead.org
Subject: Re: [PATCH RFC 2/6] mm/slub: add sheaf support for batching kfree_rcu() operations
Date: Wed, 20 Nov 2024 13:37:32 +0100 [thread overview]
Message-ID: <Zz3YDI4Bb04opI2d@pc636> (raw)
In-Reply-To: <cc7f24b8-4de5-4023-b40b-5f62287aafe8@suse.cz>
On Sun, Nov 17, 2024 at 12:01:01PM +0100, Vlastimil Babka wrote:
> On 11/14/24 17:57, Uladzislau Rezki wrote:
> > On Tue, Nov 12, 2024 at 05:38:46PM +0100, Vlastimil Babka wrote:
> >> --- a/kernel/rcu/tree.c
> >> +++ b/kernel/rcu/tree.c
> >> @@ -65,6 +65,7 @@
> >> #include <linux/kasan.h>
> >> #include <linux/context_tracking.h>
> >> #include "../time/tick-internal.h"
> >> +#include "../../mm/slab.h"
> >>
> >> #include "tree.h"
> >> #include "rcu.h"
> >> @@ -3420,7 +3421,7 @@ kvfree_rcu_list(struct rcu_head *head)
> >> trace_rcu_invoke_kvfree_callback(rcu_state.name, head, offset);
> >>
> >> if (!WARN_ON_ONCE(!__is_kvfree_rcu_offset(offset)))
> >> - kvfree(ptr);
> >> + __kvfree_rcu(ptr);
> >>
> >> rcu_lock_release(&rcu_callback_map);
> >> cond_resched_tasks_rcu_qs();
> >> @@ -3797,6 +3798,9 @@ void kvfree_call_rcu(struct rcu_head *head, void *ptr)
> >> if (!head)
> >> might_sleep();
> >>
> >> + if (kfree_rcu_sheaf(ptr))
> >> + return;
> >> +
> >>
> > This change crosses all effort which has been done in order to improve kvfree_rcu :)
>
> Yeah I know, but it wasn't intended to make it all obsolete as I don't think
> every kfree_rcu() user would have a sheaf-enabled cache.
>
> > For example:
> > performance, app launch improvements for Android devices;
> > memory consumption optimizations to minimize LMK triggering;
> > batching to speed-up offloading;
> > etc.
>
> Yes it's a great effort that I appreciate and you did probably all that was
> possible to do without changing the slab allocator itself.
>
> > So we have done a lot of work there. We were thinking about moving all
> > functionality from "kernel/rcu" to "mm/". As a first step i can do that,
> > i.e. move kvfree_rcu() as is. After that we can switch to second step.
>
> Yeah we have discussed that with Paul at LSF/MM as well and I agreed it
> makes sense, but didn't get to it yet.
>
> > Sounds good for you or not?
>
> Sounds good, thanks!
>
Thank you. Let me try to start moving it into mm/. I am thinking to place
it to the slab_common.c file. I am not sure if it makes sense to have a
dedicated file name for this purpose.
Anyway, share your view if you want to add something. Otherwise i can
proceed with that process.
--
Uladzislau Rezki
next prev parent reply other threads:[~2024-11-20 12:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 16:38 [PATCH RFC 0/6] SLUB percpu sheaves Vlastimil Babka
2024-11-12 16:38 ` [PATCH RFC 1/6] mm/slub: add opt-in caching layer of " Vlastimil Babka
2024-11-12 16:38 ` [PATCH RFC 2/6] mm/slub: add sheaf support for batching kfree_rcu() operations Vlastimil Babka
2024-11-14 16:57 ` Uladzislau Rezki
2024-11-17 11:01 ` Vlastimil Babka
2024-11-20 12:37 ` Uladzislau Rezki [this message]
2024-11-25 11:02 ` Vlastimil Babka
2024-11-25 11:18 ` Uladzislau Rezki
2024-11-28 16:24 ` Uladzislau Rezki
2024-11-29 13:54 ` Vlastimil Babka
2024-11-29 14:20 ` Uladzislau Rezki
2024-11-12 16:38 ` [PATCH RFC 3/6] maple_tree: use percpu sheaves for maple_node_cache Vlastimil Babka
2024-11-12 16:38 ` [PATCH RFC 4/6] mm, vma: use sheaves for vm_area_struct cache Vlastimil Babka
2024-11-12 16:38 ` [PATCH RFC 5/6] mm, slub: cheaper locking for percpu sheaves Vlastimil Babka
2024-11-12 16:38 ` [PATCH RFC 6/6] mm, slub: sheaf prefilling for guaranteed allocations Vlastimil Babka
2024-11-18 13:13 ` Hyeonggon Yoo
2024-11-18 14:26 ` Vlastimil Babka
2024-11-19 2:29 ` Hyeonggon Yoo
2024-11-19 8:27 ` 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=Zz3YDI4Bb04opI2d@pc636 \
--to=urezki@gmail.com \
--cc=42.hyeyoo@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=boqun.feng@gmail.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=maple-tree@lists.infradead.org \
--cc=paulmck@kernel.org \
--cc=penberg@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--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