Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
	Pedro Falcato <pfalcato@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Hao Li <hao.li@linux.dev>, Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Suren Baghdasaryan <surenb@google.com>,
	"Liam R. Howlett" <liam@infradead.org>
Subject: Re: [PATCH RFC 0/8] mm/slab: enable runtime sheaves tuning
Date: Tue, 9 Jun 2026 22:54:36 +0900	[thread overview]
Message-ID: <78ce28fd-62eb-4197-b167-73be7bd86217@kernel.org> (raw)
In-Reply-To: <e8f0e69f-c846-423c-9ee7-cbc62675697f@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 2144 bytes --]



On 6/9/26 9:52 PM, Vlastimil Babka (SUSE) wrote:
> On 5/20/26 06:35, Harry Yoo wrote:
>>
>>>> ==========
>>>>
>>>> 1. Allocations and frees can happen concurrently at any point between
>>>>     these steps, and we cannot introduce heavyweight synchronization
>>>>     mechanisms on the fastpath.
>>>>
>>>> 2. Currently, cache_has_sheaves() checks whether a cache has sheaves.
>>>>     This works now because sheaves cannot be enabled or disabled once
>>>>     the cache is created.
>>>>
>>>>     The question "Does this cache has sheaves?" should be split into
>>>>     "Does this cache support sheaves?" and "Does this CPU actually has
>>>>      sheaves enabled right now?".
>>>>
>>>> 3. Once the sheaf capacity update is complete, no sheaf with stale
>>>>     capacity must remain.
>>>
>>> Why? I don't see a huge problem with having multiple sheaves with different
>>> capacities, as long as you adequately, opportunistically kill the sheaves
>>> if they don't have the desired size (say, once a sheaf is fully empty).
>>
>> Haha, you got me.
>>
>> Right, enforcing a single capacity at any given point introduced so much 
>> complexity that I started wondering myself about whether this is really 
>> essential.
>>
>> My main concern was that the performance characteristics would become 
>> too unpredictable, but actually, users can avoid that by disabling 
>> sheaves, shrinking it, and re-enabling it. So that's not an enough 
>> justification.
> 
> My concern would have been that we would need to track capacity per sheaf if
> we allowed sheaves with different capacities to coexist.
> But patch 3 here already does that, so it seems it's necessary anyway...

It is challenging to avoid that because, let's say, a CPU releases local
lock, goes to sleep to reclaim memory to allocate a sheaf, re-acquire
the lock, and install it. But sheaf capacity might change or sheaves can
be disabled in the meantime.

Probably wrapping the entire alloc/free path with something like
SRCU-fast might help avoid that... but that sounds quite ambitious (to me).

-- 
Cheers,
Harry / Hyeonggon


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-06-09 13:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 16:24 [PATCH RFC 0/8] mm/slab: enable runtime sheaves tuning Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 1/8] mm/slab: do not store cache pointer in struct slab_sheaf Harry Yoo (Oracle)
2026-05-19  4:08   ` Hao Li
2026-05-15 16:24 ` [PATCH RFC 2/8] mm/slab: change sheaf_capacity type to unsigned short Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 3/8] mm/slab: track capacity per sheaf Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 4/8] mm/slab: allow bootstrap_cache_sheaves() to fail Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 5/8] mm/slab: rework cache_has_sheaves() to check immutable properties only Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 6/8] mm/slab: allow changing sheaf_capacity at runtime Harry Yoo (Oracle)
2026-05-17  8:30   ` Yeoreum Yun
2026-05-18  6:53     ` Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 7/8] mm/slab: add pcs->lock lockdep assert when accessing the barn Harry Yoo (Oracle)
2026-05-15 16:24 ` [PATCH RFC 8/8] mm/slab: allow changing max_{full,empty}_sheaves at runtime Harry Yoo (Oracle)
2026-05-18 11:52 ` [PATCH RFC 0/8] mm/slab: enable runtime sheaves tuning Pedro Falcato
2026-05-20  4:35   ` Harry Yoo
2026-06-09 12:52     ` Vlastimil Babka (SUSE)
2026-06-09 13:54       ` 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=78ce28fd-62eb-4197-b167-73be7bd86217@kernel.org \
    --to=harry@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pfalcato@suse.de \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.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