From: Harry Yoo <harry.yoo@oracle.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
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 unnecessary call to compound_head() in alloc_from_pcs()
Date: Tue, 25 Nov 2025 04:14:07 +0900 [thread overview]
Message-ID: <aSSuf5OG41sOGryI@hyeyoo> (raw)
In-Reply-To: <20251124142329.1691780-1-willy@infradead.org>
On Mon, Nov 24, 2025 at 02:23:27PM +0000, Matthew Wilcox (Oracle) wrote:
> Each page knows which node it belongs to, so there's no need to
> convert to a folio.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
Nice observation!
Looks good to me,
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
> mm/slub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index e4a02586dacf..e6a330e24145 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5126,7 +5126,7 @@ void *alloc_from_pcs(struct kmem_cache *s, gfp_t gfp, int node)
> * be false because of cpu migration during an unlocked part of
> * the current allocation or previous freeing process.
> */
> - if (folio_nid(virt_to_folio(object)) != node) {
> + if (page_to_nid(virt_to_page(object)) != node) {
> local_unlock(&s->cpu_sheaves->lock);
> return NULL;
> }
> --
> 2.47.2
>
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2025-11-24 19:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 14:23 Matthew Wilcox (Oracle)
2025-11-24 19:14 ` Harry Yoo [this message]
2025-11-25 13:13 ` 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=aSSuf5OG41sOGryI@hyeyoo \
--to=harry.yoo@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--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