mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Chris Li <chrisl@kernel.org>, Nhat Pham <nphamcs@gmail.com>
Cc: akpm@linux-foundation.org, kasong@tencent.com,
	hannes@cmpxchg.org,  mhocko@kernel.org, roman.gushchin@linux.dev,
	shakeel.butt@linux.dev,  yosry@kernel.org, david@kernel.org,
	muchun.song@linux.dev,  shikemeng@huaweicloud.com,
	baoquan.he@linux.dev, baohua@kernel.org,  youngjun.park@lge.com,
	chengming.zhou@linux.dev, ljs@kernel.org,  liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	 qi.zheng@linux.dev, axelrasmussen@google.com,
	yuanchu@google.com,  weixugc@google.com, gourry@gourry.net,
	haowenchao22@gmail.com, corbet@lwn.net, 	hughd@google.com,
	baolin.wang@linux.alibaba.com, tj@kernel.org, mkoutny@suse.com,
		skhan@linuxfoundation.org, kunwu.chan@linux.dev,
	kernel-team@meta.com, 	linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	 cgroups@vger.kernel.org
Subject: Re: [PATCH v5 01/11] mm, swap: add virtual swap device infrastructure
Date: Thu, 24 Sep 2026 14:12:36 -0400	[thread overview]
Message-ID: <7571f005bca65aa4ad5e7ec89e62801ad058b689.camel@surriel.com> (raw)
In-Reply-To: <CACePvbVaDNspMDSw_qAcapKAzXj3JGV-KMYmow7aePa0POHpSg@mail.gmail.com>

On Tue, 2026-09-22 at 23:18 -1000, Chris Li wrote:
> On Fri, Sep 18, 2026 at 1:03 PM Nhat Pham <nphamcs@gmail.com> wrote:
> > 
> > 
> > @@ -482,6 +491,11 @@ void swap_read_folio(struct swap_io_ctx *ctx,
> > struct folio *folio)
> >         if (zswap_load(folio) != -ENOENT)
> >                 goto finish;
> > 
> > +       if (unlikely(swap_is_vswap(sis))) {
> 
> There are too many swap_is_vswap() in this series. It fragments the
> code path, making things harder to reason about. Esepcially around
> locks. I count 22 in this patch alone.
> 
> I consider this the biggest drawback of this series. This
> fragmentation of the code path.

Could we avoid that by simply always having everything
go through the vswap abstraction layer?

When everything in vswap, we don't need to test for it.

Handling the details of what's behind the vswap would
be handled one layer down.

Chris, do you think that would be cleaner?

What am I missing?

-- 
All Rights Reversed.

  parent reply	other threads:[~2026-09-24 18:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 18:02 [PATCH v5 00/11] Virtual Swap Space (Swap Table Edition) Nhat Pham
2026-09-18 18:02 ` [PATCH v5 01/11] mm, swap: add virtual swap device infrastructure Nhat Pham
2026-09-23  9:18   ` Chris Li
2026-09-24 16:20     ` Nhat Pham
2026-09-24 18:12     ` Rik van Riel [this message]
2026-09-18 18:02 ` [PATCH v5 02/11] mm, swap: support zswap and zero-filled swap pages as vswap backends Nhat Pham
2026-09-18 18:02 ` [PATCH v5 03/11] mm, swap: prepare the swap IO path for vswap Nhat Pham
2026-09-18 18:02 ` [PATCH v5 04/11] mm, swap: support physical swap as a vswap backend Nhat Pham
2026-09-18 18:02 ` [PATCH v5 05/11] mm, swap: enable THP swapin for vswap entries Nhat Pham
2026-09-18 18:02 ` [PATCH v5 06/11] mm, swap: write back vswap zswap entries to physical swap Nhat Pham
2026-09-18 18:02 ` [PATCH v5 07/11] mm, swap: reclaim physical slots backing cache-only vswap entries Nhat Pham
2026-09-18 18:02 ` [PATCH v5 08/11] mm, swap: only charge physical swap entries Nhat Pham
2026-09-18 18:02 ` [PATCH v5 09/11] mm, swap: add debugfs counters for vswap Nhat Pham
2026-09-18 18:02 ` [PATCH v5 10/11] mm, swap: defer memcg_table allocation for physical swap clusters Nhat Pham
2026-09-18 18:02 ` [RFC PATCH v5 11/11] mm, swap: back vswap clusters with a VM_SPARSE array Nhat Pham
2026-09-18 18:38 ` [PATCH v5 00/11] Virtual Swap Space (Swap Table Edition) Nhat Pham
2026-09-21 13:42 ` [syzbot ci] " syzbot ci
2026-09-21 19:00   ` Nhat Pham
2026-09-24 12:54 ` [PATCH v5 00/11] " Klara Modin

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=7571f005bca65aa4ad5e7ec89e62801ad058b689.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=baoquan.he@linux.dev \
    --cc=cgroups@vger.kernel.org \
    --cc=chengming.zhou@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=corbet@lwn.net \
    --cc=david@kernel.org \
    --cc=gourry@gourry.net \
    --cc=hannes@cmpxchg.org \
    --cc=haowenchao22@gmail.com \
    --cc=hughd@google.com \
    --cc=kasong@tencent.com \
    --cc=kernel-team@meta.com \
    --cc=kunwu.chan@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=nphamcs@gmail.com \
    --cc=qi.zheng@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=rppt@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=shikemeng@huaweicloud.com \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=tj@kernel.org \
    --cc=vbabka@kernel.org \
    --cc=weixugc@google.com \
    --cc=yosry@kernel.org \
    --cc=youngjun.park@lge.com \
    --cc=yuanchu@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

all inboxes | Powered by JetHome®