From: Johannes Weiner <hannes@cmpxchg.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Nhat Pham <nphamcs@gmail.com>,
Chengming Zhou <zhouchengming@bytedance.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/20] mm: zswap: cleanups
Date: Tue, 30 Jan 2024 10:46:32 -0500 [thread overview]
Message-ID: <20240130154632.GB772725@cmpxchg.org> (raw)
In-Reply-To: <ZbiwW5BJhFeGc2Bd@google.com>
On Tue, Jan 30, 2024 at 08:16:27AM +0000, Yosry Ahmed wrote:
> Hey Johannes,
>
> On Mon, Jan 29, 2024 at 08:36:36PM -0500, Johannes Weiner wrote:
> > Cleanups and maintenance items that accumulated while reviewing zswap
> > patches. Based on akpm/mm-unstable + the UAF fix I sent just now.
>
> Patches 1 to 9 LGTM, thanks for the great cleanups!
>
> I am less excited about patches 10 to 20 though. Don't get me wrong, I
> am all of logically ordering the code. However, it feels like in this
> case, we will introduce unnecessary layers in the git history in a lot
> of places where I find myself checking the history regularly.
> Personally, I tend to jump around the file using vim search or using a
> cscope extension to find references/definitions, so I don't feel a need
> for such reordering.
I agree that sweeping non-functional changes can be somewhat
painful. However, moves are among the easiest of those because the
code itself doesn't change. git log is not really affected, git blame
<ref-just-before-move> mm/zswap.c works as well. Backports are easy to
adjust and verify - mostly, patch will just warn about line offsets.
What motivated this was figuring out the writeback/swapoff race. I
also use search and multiple buffers in my editor, but keeping track
of the dependencies between shrink_memcg_cb, zswap_writeback_entry and
third places like load and invalidate became quite unwieldy. There is
also the search in the logical direction not finding things, or mostly
unrelated stuff. It's just less error prone to read existing code and
write new code if related layers are grouped together and the order is
logical, despite having those tools.
The problem will also only get worse if there are no natural anchor
points for new code, and the layering isn't clear. The new shrinker
code is a case in point. We missed the opportunity in the memcg
codebase, and I've regretted it for years. It just resulted in more
fragile, less readable and debuggable code. The zswap code has been
stagnant in the last few years, and there are relatively few commits
behind us (git log --pretty=format:"%as %h %s" mm/zswap.c). I figure
now is a good chance, before the more major changes we have planned.
> I am not objecting to it, but I just find it less appealing that the
> rest of the series.
Understood.
next prev parent reply other threads:[~2024-01-30 15:46 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 1:36 Johannes Weiner
2024-01-30 1:36 ` [PATCH 01/20] mm: zswap: rename zswap_free_entry to zswap_entry_free Johannes Weiner
2024-01-30 3:13 ` Chengming Zhou
[not found] ` <20240130031938.GA772725@cmpxchg.org>
2024-01-30 3:21 ` Chengming Zhou
2024-01-30 3:36 ` Chengming Zhou
2024-01-30 8:08 ` Yosry Ahmed
2024-01-30 9:11 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 02/20] mm: zswap: inline and remove zswap_entry_find_get() Johannes Weiner
2024-01-30 3:37 ` Chengming Zhou
2024-01-30 8:09 ` Yosry Ahmed
2024-01-30 16:24 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 03/20] mm: zswap: move zswap_invalidate_entry() to related functions Johannes Weiner
2024-01-30 3:38 ` Chengming Zhou
2024-01-30 8:09 ` Yosry Ahmed
2024-01-30 16:25 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 04/20] mm: zswap: warn when referencing a dead entry Johannes Weiner
2024-01-30 3:39 ` [External] " Chengming Zhou
2024-01-30 8:10 ` Yosry Ahmed
2024-01-30 16:27 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 05/20] mm: zswap: clean up zswap_entry_put() Johannes Weiner
2024-01-30 3:39 ` Chengming Zhou
2024-01-30 7:51 ` Yosry Ahmed
2024-01-30 16:31 ` Nhat Pham
2024-01-30 17:02 ` Yosry Ahmed
2024-01-30 8:10 ` Yosry Ahmed
2024-01-30 1:36 ` [PATCH 06/20] mm: zswap: rename __zswap_load() to zswap_decompress() Johannes Weiner
2024-01-30 3:19 ` Chengming Zhou
2024-01-30 8:11 ` Yosry Ahmed
2024-01-30 16:33 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 07/20] mm: zswap: break out zwap_compress() Johannes Weiner
2024-01-30 3:23 ` Chengming Zhou
2024-01-30 8:11 ` Yosry Ahmed
2024-01-30 16:21 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 08/20] mm: zswap: further cleanup zswap_store() Johannes Weiner
2024-01-30 3:35 ` Chengming Zhou
2024-01-30 8:12 ` Yosry Ahmed
2024-01-30 18:18 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 09/20] mm: zswap: simplify zswap_invalidate() Johannes Weiner
2024-01-30 3:35 ` Chengming Zhou
2024-01-30 8:12 ` Yosry Ahmed
2024-01-30 16:50 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 10/20] mm: zswap: function ordering: pool alloc & free Johannes Weiner
2024-01-30 19:31 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 11/20] mm: zswap: function ordering: pool refcounting Johannes Weiner
2024-01-30 20:13 ` Nhat Pham
2024-01-31 11:23 ` Johannes Weiner
2024-01-31 23:23 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 12/20] mm: zswap: function ordering: zswap_pools Johannes Weiner
2024-01-30 21:16 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 13/20] mm: zswap: function ordering: pool params Johannes Weiner
2024-01-30 21:22 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 14/20] mm: zswap: function ordering: public lru api Johannes Weiner
2024-01-30 23:47 ` Nhat Pham
2024-01-31 11:40 ` Johannes Weiner
2024-01-30 1:36 ` [PATCH 15/20] mm: zswap: function ordering: move entry sections out of LRU section Johannes Weiner
2024-01-30 23:48 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 16/20] mm: zswap: function ordering: move entry section out of tree section Johannes Weiner
2024-01-31 23:24 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 17/20] mm: zswap: function ordering: compress & decompress functions Johannes Weiner
2024-01-31 23:25 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 18/20] mm: zswap: function ordering: per-cpu compression infra Johannes Weiner
2024-01-31 23:33 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 19/20] mm: zswap: function ordering: writeback Johannes Weiner
2024-01-31 23:36 ` Nhat Pham
2024-01-30 1:36 ` [PATCH 20/20] mm: zswap: function ordering: shrink_memcg_cb Johannes Weiner
2024-01-31 23:37 ` Nhat Pham
2024-01-30 8:16 ` [PATCH 00/20] mm: zswap: cleanups Yosry Ahmed
2024-01-30 12:21 ` Sergey Senozhatsky
2024-01-30 15:52 ` Johannes Weiner
2024-01-31 1:03 ` Sergey Senozhatsky
2024-01-30 15:46 ` Johannes Weiner [this message]
2024-01-30 17:15 ` Yosry Ahmed
2024-01-30 23:54 ` Nhat Pham
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=20240130154632.GB772725@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.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