linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Harry Yoo <harry.yoo@oracle.com>
To: "Christoph Lameter (Ampere)" <cl@gentwo.org>
Cc: vbabka@suse.cz, rientjes@google.com, akpm@linux-foundation.org,
	roman.gushchin@linux.dev, willy@infradead.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm/slab: fix folio_test_{anon,ksm}() false positive on slabs
Date: Tue, 10 Jun 2025 21:39:09 +0900	[thread overview]
Message-ID: <aEgnbbjPacfb5YGg@hyeyoo> (raw)
In-Reply-To: <3fcbe4a8-dfc6-c708-f765-859d9f191c91@gentwo.org>

On Mon, Jun 09, 2025 at 09:06:04AM -0700, Christoph Lameter (Ampere) wrote:
> On Mon, 9 Jun 2025, Harry Yoo wrote:
> 
> >   [ field ]		[ offset ] [ size ]
> >   page->mapping		24         8
> >   page->lru		8	   16
> >
> >   slab->next		16	   8
> >   slab->slabs		24	   4
> >
> > Reorder ->slabs and ->next, so that the layout will be:
> >
> >   slab->slabs		16	   4
> >   slab->next		24	   8
> >
> > After reordering, slab->slabs shares its offset with page->lru.prev,
> > which is not a problem. slab->next now shares the offset with
> > page->mapping, but that's fine, as a slab is double-word aligned.
> 
> Add comments to document the trickery that is going on here? Otherwise we
> may stumble across this issue again later.

Will add, thanks!

-- 
Cheers,
Harry / Hyeonggon


      reply	other threads:[~2025-06-10 12:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 13:27 Harry Yoo
2025-06-09 14:12 ` Harry Yoo
2025-06-09 14:22 ` Vlastimil Babka
2025-06-10 12:38   ` Harry Yoo
2025-06-10 13:03     ` Vlastimil Babka
2025-06-10 13:17       ` Harry Yoo
2025-06-12 12:44         ` David Hildenbrand
2025-06-09 16:06 ` Christoph Lameter (Ampere)
2025-06-10 12:39   ` Harry Yoo [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=aEgnbbjPacfb5YGg@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