From: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
To: vitaly.wool@konsulko.com, minchan@kernel.org,
senozhatsky@chromium.org, yosryahmed@google.com,
linux-mm@kvack.org
Cc: ddstreet@ieee.org, sjenning@redhat.com, nphamcs@gmail.com,
hannes@cmpxchg.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Subject: [PATCH v3 0/7] mm: zswap: move writeback LRU from zpool to zswap
Date: Mon, 12 Jun 2023 11:38:08 +0200 [thread overview]
Message-ID: <20230612093815.133504-1-cerasuolodomenico@gmail.com> (raw)
This series aims to improve the zswap reclaim mechanism by reorganizing
the LRU management. In the current implementation, the LRU is maintained
within each zpool driver, resulting in duplicated code across the three
drivers. The proposed change consists in moving the LRU management from
the individual implementations up to the zswap layer.
The primary objective of this refactoring effort is to simplify the
codebase. By unifying the reclaim loop and consolidating LRU handling
within zswap, we can eliminate redundant code and improve
maintainability. Additionally, this change enables the reclamation of
stored pages in their actual LRU order. Presently, the zpool drivers
link backing pages in an LRU, causing compressed pages with different
LRU positions to be written back simultaneously.
The series consists of several patches. The first patch implements the
LRU and the reclaim loop in zswap, but it is not used yet because all
three driver implementations are marked as zpool_evictable.
The following three commits modify each zpool driver to be not
zpool_evictable, allowing the use of the reclaim loop in zswap.
As the drivers removed their shrink functions, the zpool interface is
then trimmed by removing zpool_evictable, zpool_ops, and zpool_shrink.
Finally, the code in zswap is further cleaned up by simplifying the
writeback function and removing the now unnecessary zswap_header.
Based on mm-stable + commit 414fb1ae68b7("mm: zswap: support exclusive
loads") currently in mm-unstable.
V2:
- fixed lru list init/del/del_init (Johannes)
- renamed pool.lock to lru_lock and added lock ordering comment (Yosry)
- trimmed zsmalloc even more (Johannes | Nhat)
- moved ref drop out of writeback function (Johannes)
V3:
- rebased on commit 414fb1ae68b7 ("mm: zswap: support exclusive loads")
- renamed zswap_shrink to zswap_reclaim_entry (Yosry)
- compacted reclaim entry function dropping tree_entry (Johannes)
- deleted .shrink = NULL from driver-specific patches and re-worded
commit messages (Minchan and Johannes)
- fixed some indentations and comments (Johannes)
Domenico Cerasuolo (7):
mm: zswap: add pool shrinking mechanism
mm: zswap: remove page reclaim logic from zbud
mm: zswap: remove page reclaim logic from z3fold
mm: zswap: remove page reclaim logic from zsmalloc
mm: zswap: remove shrink from zpool interface
mm: zswap: simplify writeback function
mm: zswap: remove zswap_header
include/linux/zpool.h | 20 +--
mm/z3fold.c | 249 +-------------------------
mm/zbud.c | 167 +-----------------
mm/zpool.c | 48 +----
mm/zsmalloc.c | 396 ++----------------------------------------
mm/zswap.c | 190 +++++++++++---------
6 files changed, 134 insertions(+), 936 deletions(-)
--
2.34.1
next reply other threads:[~2023-06-12 9:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 9:38 Domenico Cerasuolo [this message]
2023-06-12 9:38 ` [PATCH v3 1/7] mm: zswap: add pool shrinking mechanism Domenico Cerasuolo
2023-06-12 13:34 ` Johannes Weiner
2023-06-12 18:18 ` Yosry Ahmed
2023-06-18 4:38 ` Sergey Senozhatsky
2023-06-18 4:48 ` Yosry Ahmed
2023-06-18 5:25 ` Sergey Senozhatsky
2023-06-18 5:28 ` Yosry Ahmed
2023-06-18 5:30 ` Sergey Senozhatsky
2023-06-18 5:31 ` Yosry Ahmed
2023-06-12 9:38 ` [PATCH v3 2/7] mm: zswap: remove page reclaim logic from zbud Domenico Cerasuolo
2023-06-12 9:38 ` [PATCH v3 3/7] mm: zswap: remove page reclaim logic from z3fold Domenico Cerasuolo
2023-06-12 9:38 ` [PATCH v3 4/7] mm: zswap: remove page reclaim logic from zsmalloc Domenico Cerasuolo
2023-06-12 9:38 ` [PATCH v3 5/7] mm: zswap: remove shrink from zpool interface Domenico Cerasuolo
2023-06-12 9:38 ` [PATCH v3 6/7] mm: zswap: simplify writeback function Domenico Cerasuolo
2023-06-12 13:38 ` Johannes Weiner
2023-06-12 9:38 ` [PATCH v3 7/7] mm: zswap: remove zswap_header Domenico Cerasuolo
2023-06-12 18:47 ` 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=20230612093815.133504-1-cerasuolodomenico@gmail.com \
--to=cerasuolodomenico@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=senozhatsky@chromium.org \
--cc=sjenning@redhat.com \
--cc=vitaly.wool@konsulko.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