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 <chengming.zhou@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: zswap: increase shrinking protection for zswap swapins only
Date: Wed, 20 Mar 2024 05:50:53 -0400 [thread overview]
Message-ID: <20240320095053.GA294822@cmpxchg.org> (raw)
In-Reply-To: <20240320020823.337644-1-yosryahmed@google.com>
On Wed, Mar 20, 2024 at 02:08:22AM +0000, Yosry Ahmed wrote:
> Currently, the number of protected zswap entries corresponding to an
> lruvec are incremented every time we swapin a page.
Correct. This is the primary signal that the shrinker is being too
aggressive in moving entries to disk and should slow down...?
> This happens regardless of whether or not the page originated in
> zswap. Hence, swapins from disk will lead to increasing protection
> on potentially stale zswap entries. Furthermore, the increased
> shrinking protection can lead to more pages skipping zswap and going
> to disk, eventually leading to even more swapins from disk and
> starting a vicious circle.
How does shrinker protection affect zswap stores?
On the contrary, I would expect this patch to create a runaway
shrinker. The more aggressively it moves entries out to disk, the
lower the rate of zswap loads, the more aggressively it moves more
entries out to disk.
> Instead, only increase the protection when pages are loaded from zswap.
> This also has a nice side effect of removing zswap_folio_swapin() and
> replacing it with a static helper that is only called from zswap_load().
>
> No problems were observed in practice, this was found through code
> inspection.
This is missing test results :)
next prev parent reply other threads:[~2024-03-20 9:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 2:08 Yosry Ahmed
2024-03-20 2:08 ` [PATCH 2/2] mm: zswap: remove nr_zswap_stored atomic Yosry Ahmed
2024-03-21 21:09 ` Yosry Ahmed
2024-03-21 23:50 ` Nhat Pham
2024-03-21 23:57 ` Yosry Ahmed
2024-03-20 9:50 ` Johannes Weiner [this message]
2024-03-20 14:48 ` [PATCH 1/2] mm: zswap: increase shrinking protection for zswap swapins only Nhat Pham
2024-03-20 19:32 ` Yosry Ahmed
2024-03-20 19:28 ` 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=20240320095053.GA294822@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=yosryahmed@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