From: Takero Funaki <flintglass@gmail.com>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
Chengming Zhou <chengming.zhou@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] mm: zswap: fix global shrinker memcg iteration
Date: Wed, 24 Jul 2024 00:56:56 +0900 [thread overview]
Message-ID: <CAPpodddhvAzyAgwW4ZE+-OTx=mLL4Z0iD=Jf=ZTCFZbRM1b3rQ@mail.gmail.com> (raw)
In-Reply-To: <CAJD7tkbf0Sc6Q3KyFzG8jRB3Z0D3iiBYiXkjkCix3gy=PctZyQ@mail.gmail.com>
2024年7月23日(火) 15:37 Yosry Ahmed <yosryahmed@google.com>:
>
> On Fri, Jul 19, 2024 at 9:41 PM Takero Funaki <flintglass@gmail.com> wrote:
> >
> > This patch fixes an issue where the zswap global shrinker stopped
> > iterating through the memcg tree.
> >
> > The problem was that shrink_worker() would stop iterating when a memcg
> > was being offlined and restart from the tree root. Now, it properly
> > handles the offline memcg and continues shrinking with the next memcg.
>
> It is probably worth explicitly calling out that before this change,
> the shrinker would stop considering an offline memcg as a failure and
> stop after hitting 16 failures, but after this change, a failure is
> hitting the end of the tree. This means that cgroup trees with a lot
> of offline cgroups will now observe significantly higher zswap
> writeback activity.
>
> Similarly, in the next patch commit log, please explicitly call out
> the expected behavioral change, that hitting an empty memcg or
> reaching the end of a tree is no longer considered a failure if there
> is progress, which means that trees with a few cgroups using zswap
> will now observe significantly higher zswap writeback activity.
>
Thanks for the comments. Dropping the comments and changing the
commit message to:
The problem was that shrink_worker() would restart iterating memcg tree
from the tree root, considering an offline memcg as a failure, and abort
shrinking after encountering the offline memcg 16 times even if there is
only one offline memcg. After this change, an offline memcg in the tree
is no longer considered a failure. This allows the shrinker to continue
shrinking the other online memcgs regardless of whether an offline memcg
exists, gives higher zswap writeback activity.
These issues do not require many offline memcgs or empty memcgs.
Without these patches, the shrinker would abort shrinking too early
even if there is only one offline memcg or only one empty memcg. The
shrinker counted the same memcg as another failure in every tree walks
and the failures limited writeback upto 16 pages * memcgs.
next prev parent reply other threads:[~2024-07-23 15:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-20 4:41 [PATCH v3 0/2] mm: zswap: fixes for global shrinker Takero Funaki
2024-07-20 4:41 ` [PATCH v3 1/2] mm: zswap: fix global shrinker memcg iteration Takero Funaki
2024-07-22 21:39 ` Nhat Pham
2024-07-23 15:35 ` Takero Funaki
2024-07-23 15:55 ` Nhat Pham
2024-07-23 6:30 ` Yosry Ahmed
2024-07-23 6:37 ` Yosry Ahmed
2024-07-23 15:56 ` Takero Funaki [this message]
2024-07-26 2:47 ` Chengming Zhou
2024-07-20 4:41 ` [PATCH v3 2/2] mm: zswap: fix global shrinker error handling logic Takero Funaki
2024-07-22 21:51 ` Nhat Pham
2024-07-23 16:44 ` Takero Funaki
2024-07-26 3:21 ` Chengming Zhou
2024-07-26 8:54 ` Takero Funaki
2024-07-26 18:01 ` Nhat Pham
2024-07-27 11:08 ` Takero Funaki
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='CAPpodddhvAzyAgwW4ZE+-OTx=mLL4Z0iD=Jf=ZTCFZbRM1b3rQ@mail.gmail.com' \
--to=flintglass@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--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