From: 贺中坤 <hezhongkun.hzk@bytedance.com>
To: Nhat Pham <nphamcs@gmail.com>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org,
vitaly.wool@konsulko.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH] mm:zswap: fix zswap entry reclamation failure in two scenarios
Date: Tue, 14 Nov 2023 13:21:32 +0800 [thread overview]
Message-ID: <CACSyD1NyynLrrkrp-A8tGW5gUJeFQiYk_E_SO14m_7wqrddtiQ@mail.gmail.com> (raw)
In-Reply-To: <CAKEwX=NhiGyoqR3HaDCuarqGmM5CCMYDatvVEEtVKzrL8DdDbw@mail.gmail.com>
Thanks for your time, Nhat.
>
> These two cases should not count as "successful writeback" right?
>
This is true from the perspective of the writeback itself, but should it
also be considered successful from the purpose of the writeback,
i.e. whether the compressed memory and zswap_entry can be reclaimed?
> I'm slightly biased of course, since my zswap shrinker depends on this
> as one of the potential signals for over-shrinking - but that aside, I think
> that this constitutes a failed writeback (i.e should not increment writeback
> counter, and the limit-based reclaim should try again etc.). If anything,
> it will make it incredibly confusing for users.
This patch will skip the writeback step,so the writeback counter will not
be incremented. Currently MAX_RECLAIM_RETRIES is 14, shrink_worker
will often fail if writeback fails.
>
> For instance, we were trying to estimate the number of zswap store
> fails by subtracting the writeback count from the overall pswpout, and
> this could throw us off by inflating the writeback count, and deflating
> the zswap store failure count as a result.
As mentioned above, writeback counter will not be incremented.
>
> Regarding the second case specifically, I thought that was the point of
> having zswap_exclusive_loads_enabled disabled - i.e still keeps a copy
> around in the zswap pool even after a completed zswap_load? Based
> on the Kconfig documentation:
>
> "This avoids having two copies of the same page in memory
> (compressed and uncompressed) after faulting in a page from zswap.
> The cost is that if the page was never dirtied and needs to be
> swapped out again, it will be re-compressed."
>
Yes,i know the point,in the case of reading, there is no data update,
so the next swapout does not need to be compressed again.
Consider this scenario,there is a lot of data cached in memory and zswap,
hit the limit,and shrink_worker will fail. The new coming data be written
directly to swap due to zswap_store failure. Should we free the last one
to store the latest one in zswap.
next prev parent reply other threads:[~2023-11-14 5:21 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 13:06 Zhongkun He
2023-11-13 15:11 ` Nhat Pham
2023-11-14 5:21 ` 贺中坤 [this message]
2023-11-14 16:30 ` [External] " Nhat Pham
2023-11-15 12:12 ` 贺中坤
2023-11-14 17:16 ` Yosry Ahmed
2023-11-15 12:53 ` [External] " 贺中坤
2023-11-15 20:12 ` Yosry Ahmed
2023-11-16 3:33 ` 贺中坤
2023-11-16 4:09 ` Yosry Ahmed
2023-11-16 4:23 ` 贺中坤
2023-11-16 8:31 ` Huang, Ying
2023-11-16 10:34 ` [External] " 贺中坤
2023-11-16 20:11 ` Chris Li
2023-11-16 20:18 ` Yosry Ahmed
2023-11-16 20:30 ` Chris Li
2023-11-16 20:45 ` Yosry Ahmed
2023-11-17 23:30 ` Chris Li
2023-11-17 9:56 ` [External] " Zhongkun He
2023-11-17 23:47 ` Chris Li
2023-11-18 1:45 ` Zhongkun He
2023-11-18 18:43 ` Nhat Pham
2023-11-19 8:29 ` Chris Li
2023-11-20 2:42 ` Zhongkun He
2023-11-19 8:23 ` Chris Li
2023-11-20 3:16 ` Zhongkun He
2023-11-20 3:18 ` Huang, Ying
2023-11-20 5:31 ` Chris Li
2023-11-20 5:39 ` Huang, Ying
2023-11-20 5:51 ` Chris Li
2023-11-20 18:52 ` Yosry Ahmed
2023-11-21 0:54 ` Huang, Ying
2023-11-21 1:15 ` Yosry Ahmed
2023-11-21 1:53 ` Huang, Ying
2023-11-21 2:46 ` Yosry Ahmed
2023-11-21 3:32 ` Huang, Ying
2023-11-21 3: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=CACSyD1NyynLrrkrp-A8tGW5gUJeFQiYk_E_SO14m_7wqrddtiQ@mail.gmail.com \
--to=hezhongkun.hzk@bytedance.com \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=sjenning@redhat.com \
--cc=vitaly.wool@konsulko.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