linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kairui Song <ryncsn@gmail.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>,
	lsf-pc@lists.linux-foundation.org,  Chris Li <chrisl@kernel.org>,
	YoungJun Park <youngjun.park@lge.com>,
	 Barry Song <21cnbao@gmail.com>, Baoquan He <bhe@redhat.com>,
	linux-mm <linux-mm@kvack.org>,
	 Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [LSF/MM/BPF TOPIC] Swap status and roadmap discussion
Date: Tue, 24 Feb 2026 11:44:29 +0800	[thread overview]
Message-ID: <CAMgjq7DtwCkEASOpPxtgehiz1jzQY-vFpNvOpPMuPNt7U1sQng@mail.gmail.com> (raw)
In-Reply-To: <CAO9r8zOZYuQWmEvSPSmBs6gz3HEWi1-MJZ0=xxV2GkQVRpMMkg@mail.gmail.com>

On Tue, Feb 24, 2026 at 2:55 AM Yosry Ahmed <yosry@kernel.org> wrote:
>
> > > - Is 64 bits really needed for reverse mapping? For the context, reverse
> > >   mapping here is a swap entry recorded in a lower / physical device
> > >   pointing to the ghost / virtual device.
> >
> > I think you can compact this a bit. Swap space itself is not fully 64
> > bits right?
> >
> > Just not sure if the juice is worth the squeeze to save a couple of
> > bits here and there, especially if the reverse mapping is already
> > dynamic :)
>

Hi, thanks for the comment.

> I think we should actually revisit the need for a reverse mapping to
> begin with. For swapoff, we can probably scan the virtual swap space
> looking for entries that belong to the backend being swapped off. Not
> as efficient as a reverse map, but still better than the status quo of
> scanning page tables. I don't think optimizing for swapoff is worth
> the consistent overhead.

Right, I don't really think swapoff is worth that much effort too. But
there are still ideas like migration and compaction, which could
really make use of a proper reverse map.

>
> The other use cases are probably cluster readahead and swapcache-only
> reclaim, and I think both of these can also be revisited.

Agree, readahead and swap cache reclaim do need some revisit... Not
related to the revert map idea though.

I'm thinking if we can make the swap cache completely lazy and never
reclaim it proactively for non-RAM swap. And for RAM based swap
(zswap / ZRAM), do the opposite, always ensure swap cache is
reclaimed after use.


  reply	other threads:[~2026-02-24  3:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-21 10:50 Kairui Song
2026-02-23 18:38 ` Nhat Pham
2026-02-23 18:55   ` Yosry Ahmed
2026-02-24  3:44     ` Kairui Song [this message]
2026-02-24  5:37       ` Yosry Ahmed

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=CAMgjq7DtwCkEASOpPxtgehiz1jzQY-vFpNvOpPMuPNt7U1sQng@mail.gmail.com \
    --to=ryncsn@gmail.com \
    --cc=21cnbao@gmail.com \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=nphamcs@gmail.com \
    --cc=yosry@kernel.org \
    --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