linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Li <chrisl@kernel.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Nhat Pham <nphamcs@gmail.com>,
	Chengming Zhou <zhouchengming@bytedance.com>,
	 Seth Jennings <sjenning@redhat.com>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	 Dan Streetman <ddstreet@ieee.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org
Subject: Re: [PATCH v3 6/6] mm/zswap: directly use percpu mutex and buffer in load/store
Date: Tue, 19 Dec 2023 15:33:28 -0800	[thread overview]
Message-ID: <CAF8kJuMdNJTZrWsK-VkxWhCo_7=T0Cb5Cwg5nBtv-ex4M1Dhkw@mail.gmail.com> (raw)
In-Reply-To: <CAJD7tkaZDb_XwdCov1kpGbvY-VfR9_nMagOE_ajCs+bKxC8yQQ@mail.gmail.com>

Hi Yosry,


On Tue, Dec 19, 2023 at 3:05 PM Yosry Ahmed <yosryahmed@google.com> wrote:

> > The compression and decompression requires the buffer and mutex. The
> > mutex is not used other than compress and decompress, right?
> > In my mind, they are fine staying in the struct. I am not sure adding
> > an level acomp_ctx provides anything. It makes access structure
> > members deeper.
> >
> > If you care about separating out the crypto acomp,  how about just
> > remove acomp_ctx and make it an anonymous structure.
> > struct zswap_comp_ctx {
> >     struct /* cryto acomp context */ {
> >         struct crypto_acomp *acomp;
> >         struct acomp_req *req;
> >         struct crypto_wait wait;
> >      };
> >      u8 *dstmem;
> >      struct mutex *mutex;
> >  };
>
> I prefer naming the internal struct, but I am fine with an anonymous
> struct as well. I just think it's a semantically sound separation.

Ack.

>
> >
> > Then we remove other per_cpu_load as well.
> >
> > I also think the original struct name is fine, we don't need to change
> > the struct name.
>
> The original struct name makes it seems like the data in the struct is
> only used for the crypto acomp API, which is not the case.

The mutex and buffer are used associated with the crypto acomp API
that is why I think it is fine to stay within the struct as well.
Using the anonymous struct to separate it out is marginally better. I
think we are in agreement here.

Chris


  reply	other threads:[~2023-12-19 23:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 11:50 [PATCH v3 0/6] mm/zswap: dstmem reuse optimizations and cleanups Chengming Zhou
2023-12-18 11:50 ` [PATCH v3 1/6] mm/zswap: change dstmem size to one page Chengming Zhou
2023-12-18 11:50 ` [PATCH v3 2/6] mm/zswap: reuse dstmem when decompress Chengming Zhou
2023-12-18 11:50 ` [PATCH v3 3/6] mm/zswap: refactor out __zswap_load() Chengming Zhou
2023-12-19 11:59   ` Chris Li
2023-12-18 11:50 ` [PATCH v3 4/6] mm/zswap: cleanup zswap_load() Chengming Zhou
2023-12-19 12:47   ` Chris Li
2023-12-19 14:07     ` Chengming Zhou
2023-12-18 11:50 ` [PATCH v3 5/6] mm/zswap: cleanup zswap_writeback_entry() Chengming Zhou
2023-12-19 12:50   ` Chris Li
2023-12-18 11:50 ` [PATCH v3 6/6] mm/zswap: directly use percpu mutex and buffer in load/store Chengming Zhou
2023-12-19 13:29   ` Chris Li
2023-12-19 18:43     ` Nhat Pham
2023-12-19 21:39       ` Yosry Ahmed
2023-12-19 22:48         ` Chris Li
2023-12-19 23:04           ` Yosry Ahmed
2023-12-19 23:33             ` Chris Li [this message]
2023-12-20 12:20         ` Chengming Zhou
2023-12-21  0:19           ` Yosry Ahmed
2023-12-25 14:39             ` Chengming Zhou
2023-12-22 17:37           ` Chris Li
2023-12-25 14:32             ` Chengming Zhou

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='CAF8kJuMdNJTZrWsK-VkxWhCo_7=T0Cb5Cwg5nBtv-ex4M1Dhkw@mail.gmail.com' \
    --to=chrisl@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=sjenning@redhat.com \
    --cc=vitaly.wool@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox