From: Matthew Wilcox <willy@infradead.org>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
linux-mm@kvack.org
Subject: Re: [PATCH 02/10] slab: Rename slab->__page_flags to slab->flags
Date: Mon, 9 Jun 2025 13:45:48 +0100 [thread overview]
Message-ID: <aEbXfKENDuSHJonY@casper.infradead.org> (raw)
In-Reply-To: <aEZDqxFsNZuAjIcH@hyeyoo>
On Mon, Jun 09, 2025 at 11:15:07AM +0900, Harry Yoo wrote:
> > +/**
> > + * enum slab_flags - How the slab flags bits are used.
> > + * @SL_locked: Is locked with slab_lock()
> > + *
> > + * The slab flags share space with the page flags but some bits have
> > + * different interpretations. The high bits are used for information
> > + * like zone/node/section.
> > + */
> > +enum slab_flags {
> > + SL_locked,
> > +};
>
> I think we need to make sure SL_locked use the same bit as PG_locked
> at least for now?
>
> I'm not sure what prevents the MM code from checking page flags on a slab
> and getting confused by the SL_locked bit is set.
The lock bit is actually used very differently between page lock and
slab lock. If there is any code inadvertently checking one when it's
looking for the other, it's already broken. I can't think of anywhere
which would look for it; we're pretty fastidious about checking for
is_slab() before going anywhere near the lock bit.
> Or the other way around—a slab might have a page flag (e.g., PG_head) set
> and mistakenly interpret it as SL_locked.
PG_head is a good one, but I don't think we're going to run into it
before we finish the page diet.
next prev parent reply other threads:[~2025-06-09 12:45 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 [this message]
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
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=aEbXfKENDuSHJonY@casper.infradead.org \
--to=willy@infradead.org \
--cc=cl@gentwo.org \
--cc=harry.yoo@oracle.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