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]
Message-ID: <20240326204836.GC229434@cmpxchg.org>
Date: Tue, 26 Mar 2024 16:48:36 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Chris Li <chrisl@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Yosry Ahmed <yosryahmed@...gle.com>,
	Nhat Pham <nphamcs@...il.com>,
	"Matthew Wilcox (Oracle)" <willy@...radead.org>,
	Chengming Zhou <zhouchengming@...edance.com>,
	Barry Song <v-songbaohua@...o.com>
Subject: Re: [PATCH v9] zswap: replace RB tree with xarray

On Tue, Mar 26, 2024 at 11:35:43AM -0700, Chris Li wrote:
>  	/*
> -	 * When reading into the swapcache, invalidate our entry. The
> +	 * When reading into the swapcache, erase our entry. The
>  	 * swapcache can be the authoritative owner of the page and
>  	 * its mappings, and the pressure that results from having two
>  	 * in-memory copies outweighs any benefits of caching the

Not sure why you editorialized this? Your patch doesn't change those
semantics, for which "invalidation" of the backing copy is a much
better description, given we're also marking the folio dirty again etc.

Can you please send a delta fix to undo that?

> @@ -1649,8 +1581,12 @@ bool zswap_load(struct folio *folio)
>  	 * the fault fails. We remain the primary owner of the entry.)
>  	 */
>  	if (swapcache)
> -		zswap_rb_erase(&tree->rbroot, entry);
> -	spin_unlock(&tree->lock);
> +		entry = xa_erase(tree, offset);
> +	else
> +		entry = xa_load(tree, offset);
> +
> +	if (!entry)
> +		return false;
>  
>  	if (entry->length)
>  		zswap_decompress(entry, page);

Otherwise, looks good to me

Acked-by: Johannes Weiner <hannes@...xchg.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ