Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Harry Yoo <harry@kernel.org>, sashiko-reviews@lists.linux.dev
Cc: Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	"David Hildenbrand (Arm)" <david@kernel.org>,
	linux-mm@kvack.org, Chris Mason <mason@kernel.org>
Subject: Re: [PATCH 4/4] mm/slab: clear stale layout values in calculate_sizes()
Date: Tue, 1 Dec 2026 19:05:21 +0100	[thread overview]
Message-ID: <5961f1ee-78c7-4780-bb1e-5cefc067f39a@kernel.org> (raw)
In-Reply-To: <aw2VqU98l6TQoQIC@thinkstation>

On 11/30/26 16:31, Harry Yoo wrote:
> On Fri, Nov 27, 2026 at 09:16:00PM +0000, sashiko-bot@kernel.org wrote:
>> 
>> [Severity: Low]
>> Should SLAB_NO_MERGE be set on s->flags before the second calculate_sizes()
>> call rather than after it?
>> 
>> calculate_sizes() only sets SLAB_OBJ_EXT_IN_OBJ when the cache is
>> unmergeable:
>> 
>> mm/slub.c:calculate_sizes() {
>>     ...
>> 	if (slab_args_unmergeable(args, s->flags) &&
>> 			(aligned_size - size >= cache_obj_ext_size(s)))
>> 		s->flags |= SLAB_OBJ_EXT_IN_OBJ;
>>     ...
>> }
>> 
>> For a cache that was only unmergeable because of DEBUG_METADATA_FLAGS,
>> clearing DEBUG_METADATA_FLAGS and SLAB_OBJ_EXT_IN_OBJ before setting
>> SLAB_NO_MERGE makes slab_args_unmergeable(args, s->flags) return false
>> during the second calculate_sizes() call.  Even when the non-debug object
>> layout still has enough alignment padding, SLAB_OBJ_EXT_IN_OBJ is not
>> re-enabled and slab allocations fall back to separate slabobj_ext arrays.
> 
> True but I don't really care TBH :)
> It's fine either way (to me).

It will be cleaner to do as suggested, and I'm gonna respin anyway. Thanks!




  reply	other threads:[~2026-12-01 18:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 20:12 [PATCH 0/4] slab AI fixes Vlastimil Babka (SUSE)
2026-11-27 20:12 ` [PATCH 1/4] mm/slab: drop __GFP_NOFAIL when refilling sheaves Vlastimil Babka (SUSE)
2026-11-30 14:10   ` Harry Yoo
2026-11-27 20:12 ` [PATCH 2/4] mm/slab: handle __GFP_NOFAIL better with prefilled sheaves Vlastimil Babka (SUSE)
2026-11-27 21:15   ` sashiko-bot
2026-11-30 14:58   ` Harry Yoo
2026-11-27 20:12 ` [PATCH 3/4] mm/slab: keep caches that drop debug flags unmergeable Vlastimil Babka (SUSE)
2026-11-27 21:15   ` sashiko-bot
2026-11-30 15:14   ` Harry Yoo
2026-11-27 20:12 ` [PATCH 4/4] mm/slab: clear stale layout values in calculate_sizes() Vlastimil Babka (SUSE)
2026-11-27 21:16   ` sashiko-bot
2026-11-30 15:31     ` Harry Yoo
2026-12-01 18:05       ` Vlastimil Babka (SUSE) [this message]
2026-11-30 15:26   ` Harry Yoo

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=5961f1ee-78c7-4780-bb1e-5cefc067f39a@kernel.org \
    --to=vbabka@kernel.org \
    --cc=cl@gentwo.org \
    --cc=david@kernel.org \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mason@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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