linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosryahmed@google.com>
To: Chris Li <chrisl@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	 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 v7] zswap: replace RB tree with xarray
Date: Wed, 20 Mar 2024 19:46:38 +0000	[thread overview]
Message-ID: <Zfs9HjKzKlw6qGjb@google.com> (raw)
In-Reply-To: <CANeU7Q=AXzG05BPcKPJvMDzmc8QK4UDKz+zaLQAx=RCrcsBkVA@mail.gmail.com>

On Wed, Mar 20, 2024 at 12:41:48PM -0700, Chris Li wrote:
> On Wed, Mar 20, 2024 at 12:34 PM Yosry Ahmed <yosryahmed@google.com> wrote:
> > > you can expect it to be coherent.
> >
> > Fair enough, but don't we still need a barrier there? Couldn't some
> > initializations still be reorder after zswap_lru_add()?
> 
> I am under the impression that the lru list handling function already
> handles the barrier. If an explicit barrier is needed, wouldn't all
> other lru callers have barriers sprinkling all over the place?

list_lru_add() holds a lock, which implies a compiler barrier. I was
wondering if we need smp_wmb() to prevent other CPUs from observing a
partially initialized entry during writeback.

I am not sure if the list lru makes such assumptions about the need for
barriers.


  reply	other threads:[~2024-03-20 19:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  5:52 Chris Li
2024-03-20  6:13 ` Yosry Ahmed
2024-03-20  6:34   ` Chris Li
2024-03-20  7:24     ` Yosry Ahmed
2024-03-20 10:08       ` Johannes Weiner
2024-03-20 18:34         ` Chris Li
2024-03-20 19:11         ` Yosry Ahmed
2024-03-20 19:25           ` Johannes Weiner
2024-03-20 19:34             ` Yosry Ahmed
2024-03-20 19:41               ` Chris Li
2024-03-20 19:46                 ` Yosry Ahmed [this message]
2024-03-20 20:03               ` Johannes Weiner
2024-03-20 20:12                 ` Yosry Ahmed
2024-03-20 10:14 ` Johannes Weiner

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=Zfs9HjKzKlw6qGjb@google.com \
    --to=yosryahmed@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=hannes@cmpxchg.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox