From: Kairui Song <ryncsn@gmail.com>
To: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Li <chrisl@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Chengming Zhou <chengming.zhou@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Hugh Dickins <hughd@google.com>,
Matthew Wilcox <willy@infradead.org>,
Barry Song <21cnbao@gmail.com>, Nhat Pham <nphamcs@gmail.com>,
Usama Arif <usamaarif642@gmail.com>,
Ryan Roberts <ryan.roberts@arm.com>,
"Huang, Ying" <ying.huang@linux.alibaba.com>
Subject: Re: [LSF/MM/BPF TOPIC] Integrate Swap Cache, Swap Maps with Swap Allocator
Date: Wed, 5 Feb 2025 00:56:36 +0800 [thread overview]
Message-ID: <CAMgjq7DHFYWhm+Z0C5tR2U2a-N_mtmgB4+idD2S+-1438u-wWw@mail.gmail.com> (raw)
In-Reply-To: <Z6JD8Y0yf21YiUc_@google.com>
On Wed, Feb 5, 2025 at 12:44 AM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
>
> On Tue, Feb 04, 2025 at 07:44:46PM +0800, Kairui Song wrote:
> > Hi all, sorry for the late submission.
> >
> > Following previous work and topics with the SWAP allocator
> > [1][2][3][4], this topic would propose a way to redesign and integrate
> > multiple swap data into the swap allocator, which should be a
> > future-proof design, achieving following benefits:
> > - Even lower memory usage than the current design
> > - Higher performance (Remove HAS_CACHE pin trampoline)
> > - Dynamic allocation and growth support, further reducing idle memory usage
> > - Unifying the swapin path for a more maintainable code base (Remove SYNC_IO)
> > - More extensible, provide a clean bedrock for implementing things
> > like discontinuous swapout, readahead based mTHP swapin and more.
> >
> > People have been complaining about the SWAP management subsystem [5].
> > Many incremental workarounds and optimizations are added, but causes
> > many other problems eg. [6][7][8][9] and making implementing new
> > features more difficult. One reason is the current design almost has
> > the minimal memory usage (1 byte swap map) with acceptable
> > performance, so it's hard to beat with incremental changes. But
> > actually as more code and features are added, there are already lots
> > of duplicated parts. So I'm proposing this idea to overhaul whole SWAP
> > slot management from a different aspect, as the following work on the
> > SWAP allocator [2].
> >
> > Chris's topic "Swap abstraction" at LSFMM 2024 [1] raised the idea of
> > unifying swap data, we worked together to implement the short term
> > solution first: The swap allocator was the bottleneck for performance
> > and fragmentation issues. The new cluster allocator solved these
> > issues, and turned the cluster into a basic swap management unit.
> > It also removed slot cache freeing path, and I'll post another series
> > soon to remove the slot cache allocation path, so folios will always
> > interact with the SWAP allocator directly, preparing for this long
> > term goal:
Hi Yosry,
> I believe this was first raised in some form in LSFMM 2023 [1] :)
Oh, Sorry, my bad, I didn't check the history about this well
enough... Thanks for the info!
>
> The approach described here is different, as it's cluster-based, which
> is interesting. I am interested to know how this helps separate the swap
> core layer from the underlying backing, as Johannes asked.
>
> In all cases, Nhat is also working on something similar, so we need some
> coordination here to avoid duplicated/conflicting work.
Right, I saw that, I think this is no fundamental conflict, as so far
the cluster based table approach is mostly focusing on the index and
allocation/freeing (also swapin/swapout) simplification. Things and
ideas mostly emerged while I was working on the swap allocator last
year, and to address the discontinuous swapout and min swapout order
issue Chris shared some very helpful insights that will come suitable
with this approach.
I fully agree that we can discuss and figure out a way to arrange the
development and implement things with the optimal approach :)
>
> Thanks!
>
> [1]https://lwn.net/Articles/932077/
>
next prev parent reply other threads:[~2025-02-04 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 11:44 Kairui Song
2025-02-04 16:24 ` Johannes Weiner
2025-02-04 16:46 ` Kairui Song
2025-02-04 18:11 ` Yosry Ahmed
2025-02-04 18:38 ` Kairui Song
2025-02-04 19:09 ` Johannes Weiner
2025-02-04 19:25 ` Kairui Song
2025-02-04 16:44 ` Yosry Ahmed
2025-02-04 16:56 ` Kairui Song [this message]
2025-03-26 3:23 ` 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=CAMgjq7DHFYWhm+Z0C5tR2U2a-N_mtmgB4+idD2S+-1438u-wWw@mail.gmail.com \
--to=ryncsn@gmail.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=nphamcs@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=usamaarif642@gmail.com \
--cc=willy@infradead.org \
--cc=ying.huang@linux.alibaba.com \
--cc=yosry.ahmed@linux.dev \
/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