Re: [PATCH v2] slub: keep empty main sheaf as spare in __pcs_replace_empty_main()
From: Vlastimil Babka
Date: Mon Jan 05 2026 - 11:13:27 EST
On 12/22/25 11:20, Harry Yoo wrote:
> On Mon, Dec 15, 2025 at 03:30:48PM +0100, Vlastimil Babka wrote:
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -5052,7 +5052,11 @@ __pcs_replace_empty_main(struct kmem_cache *s, struct slub_percpu_sheaves *pcs,
>> */
>>
>> if (pcs->main->size == 0) {
>> - barn_put_empty_sheaf(barn, pcs->main);
>> + if (!pcs->spare) {
>> + pcs->spare = pcs->main;
>> + } else {
>> + barn_put_empty_sheaf(barn, pcs->main);
>> + }
>
> nit: no braces for single statement?
Right, fixed up.
>> pcs->main = full;
>> return pcs;
>> }
>
> Otherwise LGTM, so:
> Reviewed-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
Thanks!