lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b843e18-1e1e-427f-832e-f49c156ee99d@suse.cz>
Date: Wed, 12 Mar 2025 15:59:06 +0100
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@...ux.com>, David Rientjes <rientjes@...gle.com>,
 Roman Gushchin <roman.gushchin@...ux.dev>,
 Hyeonggon Yoo <42.hyeyoo@...il.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 v2 01/10] slab: add opt-in caching layer of percpu
 sheaves

On 2/24/25 09:04, Harry Yoo wrote:
>> +static void barn_shrink(struct kmem_cache *s, struct node_barn *barn)
>> +{
>> +	struct list_head empty_list;
>> +	struct list_head full_list;
>> +	struct slab_sheaf *sheaf, *sheaf2;
>> +	unsigned long flags;
>> +
>> +	INIT_LIST_HEAD(&empty_list);
>> +	INIT_LIST_HEAD(&full_list);
>> +
>> +	spin_lock_irqsave(&barn->lock, flags);
>> +
>> +	list_splice_init(&barn->sheaves_full, &full_list);
>> +	barn->nr_full = 0;
>> +	list_splice_init(&barn->sheaves_empty, &empty_list);
>> +	barn->nr_empty = 0;
>> +
>> +	spin_unlock_irqrestore(&barn->lock, flags);
>> +
>> +	list_for_each_entry_safe(sheaf, sheaf2, &full_list, barn_list) {
>> +		sheaf_flush(s, sheaf);
>> +		list_move(&sheaf->barn_list, &empty_list);
>> +	}
> 
> nit: is this list_move() necessary?

You mean I can just do free_empty_sheaf(s, sheaf); ? Yeah why not.

>> +
>> +	list_for_each_entry_safe(sheaf, sheaf2, &empty_list, barn_list)
>> +		free_empty_sheaf(s, sheaf);
>> +}
> 
> Otherwise looks good to me.

Thanks.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ