All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Chris Li <chrisl@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Yosry Ahmed <yosryahmed@google.com>,
	Nhat Pham <nphamcs@gmail.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Chengming Zhou <zhouchengming@bytedance.com>,
	Barry Song <v-songbaohua@oppo.com>
Subject: Re: [PATCH v9] zswap: replace RB tree with xarray
Date: Tue, 26 Mar 2024 16:48:36 -0400	[thread overview]
Message-ID: <20240326204836.GC229434@cmpxchg.org> (raw)
In-Reply-To: <20240326-zswap-xarray-v9-1-d2891a65dfc7@kernel.org>

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@cmpxchg.org>


  parent reply	other threads:[~2024-03-26 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 18:35 [PATCH v9] zswap: replace RB tree with xarray Chris Li
2024-03-26 18:42 ` Chris Li
2024-03-26 18:48   ` Yosry Ahmed
2024-03-26 21:04   ` Nhat Pham
2024-03-26 21:20     ` Chris Li
2024-03-26 20:48 ` Johannes Weiner [this message]
2024-03-26 21:03   ` Chris Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240326204836.GC229434@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=v-songbaohua@oppo.com \
    --cc=willy@infradead.org \
    --cc=yosryahmed@google.com \
    --cc=zhouchengming@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.