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]
Date: Tue, 30 Jan 2024 11:35:53 +0800
From: Chengming Zhou <zhouchengming@...edance.com>
To: Johannes Weiner <hannes@...xchg.org>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: Nhat Pham <nphamcs@...il.com>, Yosry Ahmed <yosryahmed@...gle.com>,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/20] mm: zswap: simplify zswap_invalidate()

On 2024/1/30 09:36, Johannes Weiner wrote:
> The branching is awkward and duplicates code. The comment about
> writeback is also misleading: yes, the entry might have been written
> back. Or it might have never been stored in zswap to begin with due to
> a rejection - zswap_invalidate() is called on all exiting swap entries.
> 
> Signed-off-by: Johannes Weiner <hannes@...xchg.org>

Reviewed-by: Chengming Zhou <zhouchengming@...edance.com>

> ---
>  mm/zswap.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/mm/zswap.c b/mm/zswap.c
> index cde309c539b3..082d076a758d 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -1739,15 +1739,10 @@ void zswap_invalidate(int type, pgoff_t offset)
>  	struct zswap_tree *tree = swap_zswap_tree(swp_entry(type, offset));
>  	struct zswap_entry *entry;
>  
> -	/* find */
>  	spin_lock(&tree->lock);
>  	entry = zswap_rb_search(&tree->rbroot, offset);
> -	if (!entry) {
> -		/* entry was written back */
> -		spin_unlock(&tree->lock);
> -		return;
> -	}
> -	zswap_invalidate_entry(tree, entry);
> +	if (entry)
> +		zswap_invalidate_entry(tree, entry);
>  	spin_unlock(&tree->lock);
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ