From: Vlastimil Babka <vbabka@suse.cz>
To: Jens Axboe <axboe@kernel.dk>, Jann Horn <jannh@google.com>
Cc: Christian Brauner <brauner@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH] [RFC] mm: add kmem_cache_create_rcu()
Date: Tue, 27 Aug 2024 22:34:54 +0200 [thread overview]
Message-ID: <9e62afea-576d-4394-aad9-c3fe8e364ee1@suse.cz> (raw)
In-Reply-To: <28677022-1be8-402f-97c4-fc1aba33c77f@kernel.dk>
On 8/27/24 17:45, Jens Axboe wrote:
> On 8/27/24 9:33 AM, Jann Horn wrote:
>
> Yep should work.
>
> I like this approach as a way of unifying the various ways of creating a
> slab cache. Particularly as I'd want to use a free ptr myself for an
> in-kernel use case that currently creates a cache with
> kmem_cache_create_usercopy().
Ah right so you need effectively a combination of the current
kmem_cache_create_usercopy() and kmem_cache_create_rcu().
>> But I guess if we want to allow leaving out the freeptr_offset
>> parameter, we'd have to have a flag to say whether the freeptr_offset
>> parameter value should be used... Maybe my proposal is too overly
>> fancy...
I think it's a good way. The extra flag to denote the custom freepointer
offset is valid is a bit annoying, but there shouldn't be too many users of
that, and implicit zero-initializing is a nice thing otherwise.
>
> I think we'll end up going down that route eventually anyway to cover
> all cases, so may as well do a prep patch that does that first. At least
> that's my opinion...
>
prev parent reply other threads:[~2024-08-27 20:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 9:23 [PATCH] [POC/RFE]: Avoid silently growing struct file due to SLAB_TYPESAFE_BY_RCU Christian Brauner
2024-08-26 9:25 ` Christian Brauner
2024-08-26 16:04 ` [PATCH] [RFC] mm: add kmem_cache_create_rcu() Christian Brauner
2024-08-27 10:42 ` Mike Rapoport
2024-08-27 13:42 ` Christian Brauner
2024-08-27 14:05 ` Vlastimil Babka
2024-08-27 15:15 ` Christian Brauner
2024-08-27 15:33 ` Jann Horn
2024-08-27 15:44 ` Christian Brauner
2024-08-27 15:45 ` Jens Axboe
2024-08-27 20:34 ` Vlastimil Babka [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=9e62afea-576d-4394-aad9-c3fe8e364ee1@suse.cz \
--to=vbabka@suse.cz \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=jannh@google.com \
--cc=linux-mm@kvack.org \
--cc=paulmck@kernel.org \
--cc=roman.gushchin@linux.dev \
--cc=torvalds@linux-foundation.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