[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <446b0ed2-16e5-45fa-82a1-09ed99108558@suse.cz>
Date: Tue, 26 Aug 2025 10:03:30 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Christoph Lameter <cl@...two.org>, David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Uladzislau Rezki <urezki@...il.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
maple-tree@...ts.infradead.org
Subject: Re: [PATCH v5 01/14] slab: add opt-in caching layer of percpu sheaves
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.
Powered by blists - more mailing lists