From: Matthew Wilcox <willy@infradead.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
linux-mm@kvack.org, Harry Yoo <harry.yoo@oracle.com>,
kasan-dev <kasan-dev@googlegroups.com>,
Alexander Potapenko <glider@google.com>,
Marco Elver <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH 08/10] kfence: Remove mention of PG_slab
Date: Mon, 9 Jun 2025 16:02:04 +0100 [thread overview]
Message-ID: <aEb3bMaMoROWz3Pk@casper.infradead.org> (raw)
In-Reply-To: <ff370b8b-a33f-47a2-9815-266225e68b8a@suse.cz>
On Mon, Jun 09, 2025 at 03:33:41PM +0200, Vlastimil Babka wrote:
> On 6/7/25 00:22, Matthew Wilcox (Oracle) wrote:
> > Improve the documentation slightly, assuming I understood it correctly.
>
> Assuming I understood it correctly, this is going to be fun part of
> splitting struct slab from struct page. It gets __kfence_pool from memblock
> allocator and then makes the corresponding struct pages look like slab
> pages. Maybe it will be possible to simplify things so it won't have to
> allocate struct slab for each page...
I've been looking at this and I'm not sure I understand it correctly
either. Perhaps the kfence people can weigh in. It seems like the
kfence pages are being marked as slab pages, but not being assigned to
any particular slab cache?
Perhaps the right thing to do will be to allocate slabs for kfence
objects. Or kfence objects get their own memdesc type. It's hard to
say at this point. My plan was to disable kfence (along with almost
everything else) when CONFIG_PAGE_DIET is enabled, and then someone
who understands what's going on can come in and do the necessary to
re-enable it.
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > ---
> > mm/kfence/core.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/kfence/core.c b/mm/kfence/core.c
> > index 102048821c22..0ed3be100963 100644
> > --- a/mm/kfence/core.c
> > +++ b/mm/kfence/core.c
> > @@ -605,8 +605,8 @@ static unsigned long kfence_init_pool(void)
> > pages = virt_to_page(__kfence_pool);
> >
> > /*
> > - * Set up object pages: they must have PG_slab set, to avoid freeing
> > - * these as real pages.
> > + * Set up object pages: they must have PGTY_slab set to avoid freeing
> > + * them as real pages.
> > *
> > * We also want to avoid inserting kfence_free() in the kfree()
> > * fast-path in SLUB, and therefore need to ensure kfree() correctly
>
next prev parent reply other threads:[~2025-06-09 15:02 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 22:22 [PATCH 00/10] Various slab improvements Matthew Wilcox (Oracle)
2025-06-06 22:22 ` [PATCH 01/10] doc: Move SLUB documentation to the admin guide Matthew Wilcox (Oracle)
2025-06-09 1:42 ` Harry Yoo
2025-06-09 12:13 ` Vlastimil Babka
2025-06-06 22:22 ` [PATCH 02/10] slab: Rename slab->__page_flags to slab->flags Matthew Wilcox (Oracle)
2025-06-09 2:15 ` Harry Yoo
2025-06-09 12:45 ` Matthew Wilcox
2025-06-09 13:12 ` Vlastimil Babka
2025-06-06 22:22 ` [PATCH 03/10] slab: Add SL_private flag Matthew Wilcox (Oracle)
2025-06-09 2:25 ` Harry Yoo
2025-06-06 22:22 ` [PATCH 04/10] slab: Add SL_pfmemalloc flag Matthew Wilcox (Oracle)
2025-06-09 2:27 ` Harry Yoo
2025-06-06 22:22 ` [PATCH 05/10] doc: Add slab internal kernel-doc Matthew Wilcox (Oracle)
2025-06-09 2:37 ` Harry Yoo
2025-06-09 15:22 ` Matthew Wilcox
2025-06-06 22:22 ` [PATCH 06/10] vmcoreinfo: Remove documentation of PG_slab and PG_hugetlb Matthew Wilcox (Oracle)
2025-06-09 2:44 ` Harry Yoo
2025-06-06 22:22 ` [PATCH 07/10] proc: Remove mention of PG_slab Matthew Wilcox (Oracle)
2025-06-06 22:22 ` [PATCH 08/10] kfence: " Matthew Wilcox (Oracle)
2025-06-09 3:42 ` Harry Yoo
2025-06-09 13:33 ` Vlastimil Babka
2025-06-09 15:02 ` Matthew Wilcox [this message]
2025-06-10 13:23 ` Marco Elver
2025-06-06 22:22 ` [PATCH 09/10] memcg_slabinfo: Fix use " Matthew Wilcox (Oracle)
2025-06-09 3:08 ` Harry Yoo
2025-06-06 22:22 ` [PATCH 10/10] slab: Fix MAINTAINERS entry Matthew Wilcox (Oracle)
2025-06-09 3:21 ` Harry Yoo
2025-06-09 13:38 ` Vlastimil Babka
2025-06-09 13:59 ` Lorenzo Stoakes
2025-06-09 16:42 ` Christoph Lameter (Ampere)
2025-06-09 17:44 ` Matthew Wilcox
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=aEb3bMaMoROWz3Pk@casper.infradead.org \
--to=willy@infradead.org \
--cc=cl@gentwo.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=harry.yoo@oracle.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.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