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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Feb 2024 21:00:48 +0800
From: Chengming Zhou <zhouchengming@...edance.com>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: Nhat Pham <nphamcs@...il.com>, Johannes Weiner <hannes@...xchg.org>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org
Subject: Re: [PATCH 6/6] mm/zswap: zswap entry doesn't need refcount anymore

On 2024/2/2 09:11, Yosry Ahmed wrote:
> On Thu, Feb 01, 2024 at 03:49:06PM +0000, Chengming Zhou wrote:
>> Since we don't need to leave zswap entry on the zswap tree anymore,
>> we should remove it from tree once we find it from the tree.
>>
>> Then after using it, we can directly free it, no concurrent path
>> can find it from tree. Only the shrinker can see it from lru list,
>> which will also double check under tree lock, so no race problem.
>>
>> So we don't need refcount in zswap entry anymore and don't need to
>> take the spinlock for the second time to invalidate it.
>>
>> The side effect is that zswap_entry_free() maybe not happen in tree
>> spinlock, but it's ok since nothing need to be protected by the lock.
>>
>> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
> 
> This looks like a great simplification, and a good motivation to only
> support exclusive loads. Everything is more straightforward because
> every tree lookup implies a removal and exclusive ownership.

Right, much simpler!

> 
> Let's see if removing support for non-exclusive loads is agreeable first
> though :)

Ok, I have just posted some testing data for discussion.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ