From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Harry Yoo <harry@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
linux-mm@kvack.org
Subject: Re: [PATCH] slab: Remove slab_folio()
Date: Thu, 24 Sep 2026 09:41:58 +0200 [thread overview]
Message-ID: <96d3c629-6c03-4924-97b2-565a04c5861d@kernel.org> (raw)
In-Reply-To: <arQ5YjQbs3pd5-KS@casper.infradead.org>
On 9/23/26 22:41, Matthew Wilcox wrote:
> On Wed, Sep 23, 2026 at 10:11:06PM +0200, Vlastimil Babka (SUSE) wrote:
>> On 9/23/26 21:45, Harry Yoo wrote:
>> > With a tiny little nit:
>> >
>> >> @@ -184,15 +169,16 @@ static inline struct slab *page_slab(const struct page *page)
>> >> * slab_page - The first struct page allocated for a slab
>> >> * @s: The slab.
>> >> *
>> >> - * A convenience wrapper for converting slab to the first struct page of the
>> >> - * underlying folio, to communicate with code not yet converted to folio or
>> >> - * struct slab.
>> >> + * A convenience wrapper for returning the first page allocated to this slab.
>> >> + * to communicate with code not yet converted to struct slab.
>> > * A convenience wrapper for returning the first "struct" page allocated to this
>> > * "slab" to communicate with code not yet converted to struct slab.
>> >> */
>> >
>> > Perhaps you meant this?
>
> My eyes are old and don't notice punctuation as well as they used to.
> What I meant was:
>
> * A convenience wrapper for returning the first page allocated to this slab.
> * This is for the benefit of code not yet converted to struct slab.
>
>> Yeah, and I wonder about the "code not yet converted" part, and if there's
>> anything we can still convert right now. What I can see among slab_page() users:
>>
>> - slab_order() - we could probably add order (aliasing page's order for now)
>> to struct slab right now and that would be future-proof
>
> That's trickier than you think because it's stored in the ->flags of
> the second page when PG_head is set. When divorcing slab and page,
> it moves into struct slab, but we can't do that in advance.
Ah, I see.
>> But:
>> - slab_address() - I guess can only be converted once slab is divorced from
>> page?
>
> Yeah, it becomes slab->virtual.
>
>> - __kasan_poison_slab - same as above?
>
> The loop calling page_kasan_tag_reset() makes me think kasan really
> wants a page here.
>
>> - several VM_BUG_ON_PAGE() usages - same?
>
> We could probably introduce a VM_BUG_ON_SLAB if you're interested.
Maybe not worth the effort.
>> - validate_slab_ptr() - same?
>
> That'll change dramatically -- if we want to validate that a pointer
> really points to a slab object, we'll want to, er, ask if
> virt_to_slab() belongs to the slab slab.
>
>> __free_slab() - same, obviously
>
> Right.
next prev parent reply other threads:[~2026-09-24 7:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 18:36 [PATCH] slab: Remove slab_folio() Matthew Wilcox (Oracle)
2026-09-23 19:19 ` Gregory Price
2026-09-23 19:45 ` Harry Yoo
2026-09-23 20:11 ` Vlastimil Babka (SUSE)
2026-09-23 20:41 ` Matthew Wilcox
2026-09-24 7:41 ` Vlastimil Babka (SUSE) [this message]
2026-09-24 17:43 ` Harry Yoo (Meta)
2026-09-25 8:08 ` Vlastimil Babka (SUSE)
2026-09-25 8:35 ` Hao Li
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=96d3c629-6c03-4924-97b2-565a04c5861d@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=hao.li@linux.dev \
--cc=harry@kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--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