[PATCH v5 01/14] slab: add opt-in caching layer of percpu sheaves
Vlastimil Babka
vbabka at suse.cz
Tue Aug 26 01:03:30 PDT 2025
On 8/18/25 12:09, Harry Yoo wrote:
>> +alloc_empty:
>> + local_unlock(&s->cpu_sheaves->lock);
>> +
>> + empty = alloc_empty_sheaf(s, GFP_NOWAIT);
>> + if (empty)
>> + goto got_empty;
>> +
>> + if (put_fail)
>> + stat(s, BARN_PUT_FAIL);
>> +
>> + if (!sheaf_flush_main(s))
>> + return NULL;
>> +
>> + if (!local_trylock(&s->cpu_sheaves->lock))
>> + return NULL;
>> +
>> + /*
>> + * we flushed the main sheaf so it should be empty now,
>> + * but in case we got preempted or migrated, we need to
>> + * check again
>> + */
>> + if (pcs->main->size == s->sheaf_capacity)
>> + goto restart;
>
> I think it's missing:
>
> pcs = this_cpu_ptr(&s->cpu_sheaves);
>
> between local_trylock() and reading pcs->main->size().
Oops, yes, thanks!
Also fixed up the other things you pointed out.
More information about the maple-tree
mailing list