[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9073aa19-0f12-4dd7-8d10-2f159f3fd362@suse.cz>
Date: Tue, 22 Apr 2025 17:18:32 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Suren Baghdasaryan <surenb@...gle.com>
Cc: "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Christoph Lameter <cl@...ux.com>, David Rientjes <rientjes@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>, Harry Yoo <harry.yoo@...cle.com>,
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 RFC v3 3/8] slab: add sheaf support for batching
kfree_rcu() operations
On 4/10/25 22:24, Suren Baghdasaryan wrote:
> On Mon, Mar 17, 2025 at 7:33 AM Vlastimil Babka <vbabka@...e.cz> wrote:
>> +do_free:
>> +
>> + rcu_sheaf = pcs->rcu_free;
>> +
>> + rcu_sheaf->objects[rcu_sheaf->size++] = obj;
>> +
>> + if (likely(rcu_sheaf->size < s->sheaf_capacity)) {
>> + localtry_unlock(&s->cpu_sheaves->lock);
>> + stat(s, FREE_RCU_SHEAF);
>> + return true;
>> + }
>> +
>> + pcs->rcu_free = NULL;
>> + localtry_unlock(&s->cpu_sheaves->lock);
>> +
>> + call_rcu(&rcu_sheaf->rcu_head, rcu_free_sheaf);
>> +
>> + stat(s, FREE_RCU_SHEAF);
>> + return true;
>
> nit: I think the above code could be simplified to:
>
> do_free:
> rcu_sheaf = pcs->rcu_free;
> rcu_sheaf->objects[rcu_sheaf->size++] = obj;
> if (likely(rcu_sheaf->size < s->sheaf_capacity))
> rcu_sheaf = NULL;
> else
> pcs->rcu_free = NULL;
>
> localtry_unlock(&s->cpu_sheaves->lock);
> stat(s, FREE_RCU_SHEAF);
> if (rcu_sheaf)
> call_rcu(&rcu_sheaf->rcu_head, rcu_free_sheaf);
>
> return true;
Right, done. Thanks.
Powered by blists - more mailing lists