public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Kairui Song <ryncsn@gmail.com>
Cc: linux-mm@kvack.org, Chris Li <chrisl@kernel.org>,
	Nhat Pham <nphamcs@gmail.com>, Rik van Riel <riel@surriel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kemeng Shi <shikemeng@huaweicloud.com>,
	Baoquan He <bhe@redhat.com>, Barry Song <baohua@kernel.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	YoungJun Park <youngjun.park@lge.com>,
	linux-kernel@vger.kernel.org, pratmal@google.com,
	sweettea@google.com, gthelen@google.com, weixugc@google.com
Subject: Re: [PATCH RFC] mm: ghost swapfile support for zswap
Date: Tue, 2 Dec 2025 12:02:22 -0500	[thread overview]
Message-ID: <20251202170222.GD430226@cmpxchg.org> (raw)
In-Reply-To: <CAMgjq7Ch+M21W0YH-edngSYVfb07-m-bVq=zTenF2PLcAPt4EA@mail.gmail.com>

On Tue, Dec 02, 2025 at 03:49:22AM +0800, Kairui Song wrote:
> From my perspective, Chris did co-developed, suggested, reviewed or
> authored many of the implementation details around the swap-table
> idea, and he implemented the swap cluster allocator in 6.11, which
> unlocked a bunch of follow-on optimizations.
> 
> I’ve been working on swap for a while as well and have rewritten and
> refactored large parts of the swap, swap allocator and swap cache
> (mm/swapfile.c, mm/swap_state.c, swap.h, swap_table.h). Maybe, yeah,
> I’m not a kernel vet with decades of patches yet, but I do think I'm
> familiar enough with swap. I think Chris' work, words or code, has
> been looking good in the end results.

I have absolute respect for your work. And if you say Chris was
instrumental to getting it done, I will take your word for it.

> It's hard to put a penthouse on a sandcastle, and maybe that's the
> reason makes it hard to describe or layout the further implementations
> of swap.

Sure, I can understand that. However, I think the conflict is not
necessarily about implementation strategy, it's about priorities.

We have a usecase. We have a functional implementation that satisfies
this usecase. It was sent as RFCs early on to gain consensus on the
direction and find the best tradeoffs wrt other usecases. These RFC
threads are the place to voice concerns and influence direction.

Both Chris and you have stated that further swap table work *may* also
enable this usecase. However, at this time, I think it's also fair to
say that it's more of an afterthought, and no concrete design or code
for how this would actually look like has been proposed. High-level
ideas have been floated, but as you can see from Nhat, Rik's, Yosry's
and my replies, they don't really meet the necessary requirements.

This is not some principled stance. The virtual swap patches are
difficult to develop, especially given the current rate of change of
the underlying swap codebase. If anybody working on vswap had seen a
plausible way to solve these issues through incremental swap table
improvements they would have jumped on it a long time ago.

It's more about priorities. Combining compression with disk swap is
extremely powerful, because it dramatically reduces the worst aspects
of both: it reduces the memory footprint of compression by shedding
the coldest data to disk; it reduces the IO latencies and flash wear
of disk swap through the writeback cache. In practice, this reduces
*average event rates of the entire reclaim/paging/IO stack*.

These are higher-order overhead savings that are difficult to beat
with first-order descriptor and lookup cost optimizations.

We obviously want to have both, but they are orthogonal goals. You can
see how it doesn't make sense for us to deprioritize the former for
the latter, or why Nhat says it's an apples to oranges comparison.

It also won't work for one party to say "we will fix this, give us
time". Everybody wants to advance the thing they primarily care about
with the least amount of detours. That's where we have to find
compromise. Either let people pursue what's most important to them, or
lay out an encompassing design to build consensus and organize effort.

And yes, let's please stay technical and on-topic in these
discussions. Let's acknowledge we have interests that overlap, and
interests that do not. Then find ways to service everybody's usecases.

Disagreements are part of the game. There is no need to get personal,
pull rank, or make accusations to dismiss somebody else's clearly
stated usecase, perspective, or objections.

The best way to avoid this is to make technical statements, and reply
with technical responses where those statements are made.

  reply	other threads:[~2025-12-02 17:02 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21  9:31 [PATCH RFC] mm: ghost swapfile support for zswap Chris Li
2025-11-21 10:19 ` Nhat Pham
2025-11-22  1:52   ` Chris Li
2025-11-24 14:47     ` Nhat Pham
2025-11-25 18:26       ` Chris Li
2025-11-21 11:40 ` Johannes Weiner
2025-11-22  1:52   ` Chris Li
2025-11-22 10:29     ` Kairui Song
2025-11-24 15:35     ` Nhat Pham
2025-11-24 16:14     ` Rik van Riel
2025-11-24 17:26       ` Chris Li
2025-11-24 17:42         ` Rik van Riel
2025-11-24 17:58           ` Chris Li
2025-11-24 17:27     ` Johannes Weiner
2025-11-24 18:24       ` Chris Li
2025-11-24 19:32         ` Johannes Weiner
2025-11-25 19:27           ` Chris Li
2025-11-25 21:31             ` Johannes Weiner
2025-11-26 19:22               ` Chris Li
2025-11-26 21:52                 ` Rik van Riel
2025-11-27  1:52                   ` Chris Li
2025-11-27  2:26                     ` Rik van Riel
2025-11-27 19:09                       ` Chris Li
2025-11-28 20:46                         ` Nhat Pham
2025-11-29 20:38                           ` Chris Li
2025-12-01 16:43                             ` Johannes Weiner
2025-12-01 19:49                               ` Kairui Song
2025-12-02 17:02                                 ` Johannes Weiner [this message]
2025-12-02 20:48                                   ` Chris Li
2025-12-02 19:58                               ` Chris Li
2025-12-01 23:37                             ` Nhat Pham
2025-12-02 19:18                               ` Chris Li
2025-12-02 18:18               ` Nhat Pham
2025-12-02 21:07                 ` Chris Li
2025-11-24 19:32       ` Yosry Ahmed
2025-11-24 20:24         ` Nhat Pham
2025-11-25 18:50         ` Chris Li
2025-11-26 21:58           ` Rik van Riel
2025-11-27  2:07             ` Chris Li
2025-11-27  2:34               ` Rik van Riel
2025-11-25 18:14     ` Chris Li
2025-11-25 18:55       ` Johannes Weiner
2025-11-21 15:14 ` Yosry Ahmed
2025-11-22  1:52   ` Chris Li
2025-11-24 14:57     ` Nhat Pham
2025-11-22  9:59 ` Kairui Song
2025-11-22 13:58   ` Baoquan He
2025-12-02  2:56   ` Barry Song
2025-12-02  6:31     ` Baoquan He
2025-12-02 17:53       ` Nhat Pham
2025-12-02 21:01         ` Chris Li
2025-12-03  8:37 ` Yosry Ahmed
2025-12-03 20:02   ` Chris Li
2025-12-04  6:16     ` Yosry Ahmed
2025-12-04 10:11       ` Chris Li
2025-12-04 20:55         ` Yosry Ahmed
2025-12-05  8:56           ` Kairui Song

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=20251202170222.GD430226@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=bhe@redhat.com \
    --cc=chengming.zhou@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=pratmal@google.com \
    --cc=riel@surriel.com \
    --cc=ryncsn@gmail.com \
    --cc=shikemeng@huaweicloud.com \
    --cc=sweettea@google.com \
    --cc=weixugc@google.com \
    --cc=yosry.ahmed@linux.dev \
    --cc=youngjun.park@lge.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