From: "Sridhar, Kanchana P" <kanchana.p.sridhar@intel.com>
To: Nhat Pham <nphamcs@gmail.com>, Chengming Zhou <chengming.zhou@linux.dev>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
"yosryahmed@google.com" <yosryahmed@google.com>,
"usamaarif642@gmail.com" <usamaarif642@gmail.com>,
"ryan.roberts@arm.com" <ryan.roberts@arm.com>,
"21cnbao@gmail.com" <21cnbao@gmail.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"Feghali, Wajdi K" <wajdi.k.feghali@intel.com>,
"Gopal, Vinodh" <vinodh.gopal@intel.com>,
"Sridhar, Kanchana P" <kanchana.p.sridhar@intel.com>
Subject: RE: [PATCH v1 2/2] mm: zswap: zswap_store_pages() simplifications for batching.
Date: Tue, 3 Dec 2024 01:15:42 +0000 [thread overview]
Message-ID: <SJ0PR11MB5678F859FC683F09FF8EC958C9362@SJ0PR11MB5678.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAKEwX=Oxa6Ov25ef6uj598jpZY=pFC2pcFrHSD626zuhokhrrQ@mail.gmail.com>
> -----Original Message-----
> From: Nhat Pham <nphamcs@gmail.com>
> Sent: Monday, December 2, 2024 4:17 PM
> To: Chengming Zhou <chengming.zhou@linux.dev>
> Cc: Sridhar, Kanchana P <kanchana.p.sridhar@intel.com>; linux-
> kernel@vger.kernel.org; linux-mm@kvack.org; hannes@cmpxchg.org;
> yosryahmed@google.com; usamaarif642@gmail.com;
> ryan.roberts@arm.com; 21cnbao@gmail.com; akpm@linux-foundation.org;
> Feghali, Wajdi K <wajdi.k.feghali@intel.com>; Gopal, Vinodh
> <vinodh.gopal@intel.com>
> Subject: Re: [PATCH v1 2/2] mm: zswap: zswap_store_pages() simplifications
> for batching.
>
> On Wed, Nov 27, 2024 at 11:00 PM Chengming Zhou
> <chengming.zhou@linux.dev> wrote:
> >
> > How about introducing a `zswap_compress_folio()` interface which
> > can be used by `zswap_store()`?
> > ```
> > zswap_store()
> > nr_pages = folio_nr_pages(folio)
> >
> > entries = zswap_alloc_entries(nr_pages)
> >
> > ret = zswap_compress_folio(folio, entries, pool)
> >
> > // store entries into xarray and LRU list
> > ```
> >
> > And this version `zswap_compress_folio()` is very simple for now:
> > ```
> > zswap_compress_folio()
> > nr_pages = folio_nr_pages(folio)
> >
> > for (index = 0; index < nr_pages; ++index) {
> > struct page *page = folio_page(folio, index);
> >
> > if (!zswap_compress(page, &entries[index], pool))
> > return false;
> > }
> >
> > return true;
> > ```
> > This can be easily extended to support your "batched" version.
> >
> > Then the old `zswap_store_page()` could be removed.
> >
> > The good point is simplicity, that we don't need to slice folio
> > into multiple batches, then repeat the common operations for each
> > batch, like preparing entries, storing into xarray and LRU list...
> >
>
> +1.
Thanks Nhat. I replied with some potential considerations in my reply
to Chengming's and Yosry's comments. Would appreciate it if you can
add follow-up suggestions to that reply.
Thanks,
Kanchana
prev parent reply other threads:[~2024-12-03 1:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 22:53 [PATCH v1 0/2] Vectorize and simplify zswap_store_page() Kanchana P Sridhar
2024-11-27 22:53 ` [PATCH v1 1/2] mm: zswap: Modified zswap_store_page() to process multiple pages in a folio Kanchana P Sridhar
2024-12-02 19:33 ` Yosry Ahmed
2024-12-03 1:13 ` Sridhar, Kanchana P
2024-12-03 5:34 ` Yosry Ahmed
2024-12-03 21:25 ` Sridhar, Kanchana P
2024-12-03 3:23 ` Chengming Zhou
2024-12-03 4:37 ` Sridhar, Kanchana P
2024-11-27 22:53 ` [PATCH v1 2/2] mm: zswap: zswap_store_pages() simplifications for batching Kanchana P Sridhar
2024-11-28 7:00 ` Chengming Zhou
2024-12-02 19:32 ` Yosry Ahmed
2024-12-03 1:01 ` Sridhar, Kanchana P
2024-12-03 3:06 ` Chengming Zhou
2024-12-03 4:18 ` Sridhar, Kanchana P
2024-12-03 5:49 ` Yosry Ahmed
2024-12-03 21:28 ` Sridhar, Kanchana P
2024-12-03 0:17 ` Nhat Pham
2024-12-03 1:15 ` Sridhar, Kanchana P [this message]
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=SJ0PR11MB5678F859FC683F09FF8EC958C9362@SJ0PR11MB5678.namprd11.prod.outlook.com \
--to=kanchana.p.sridhar@intel.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=usamaarif642@gmail.com \
--cc=vinodh.gopal@intel.com \
--cc=wajdi.k.feghali@intel.com \
--cc=yosryahmed@google.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