lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKEwX=NB0MGFy2WxMebd_cZEQ__pcTH5_-LX_M85ti6NyGhmKw@mail.gmail.com>
Date: Fri, 2 Aug 2024 15:51:52 -0700
From: Nhat Pham <nphamcs@...il.com>
To: Takero Funaki <flintglass@...il.com>
Cc: Johannes Weiner <hannes@...xchg.org>, Yosry Ahmed <yosryahmed@...gle.com>, 
	Chengming Zhou <chengming.zhou@...ux.dev>, Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/2] mm: zswap: fix global shrinker error handling logic

On Tue, Jul 30, 2024 at 5:49 PM Takero Funaki <flintglass@...il.com> wrote:
>
> This patch fixes the zswap global shrinker, which did not shrink the
> zpool as expected.
>
> The issue addressed is that shrink_worker() did not distinguish between
> unexpected errors and expected errors, such as failed writeback from an
> empty memcg. The shrinker would stop shrinking after iterating through
> the memcg tree 16 times, even if there was only one empty memcg.
>
> With this patch, the shrinker no longer considers encountering an empty
> memcg, encountering a memcg with writeback disabled, or reaching the end
> of a memcg tree walk as a failure, as long as there are memcgs that are
> candidates for writeback. Systems with one or more empty memcgs will now
> observe significantly higher zswap writeback activity after the zswap
> pool limit is hit.
>
> To avoid an infinite loop when there are no writeback candidates, this
> patch tracks writeback attempts during memcg tree walks and limits
> reties if no writeback candidates are found.
>
> To handle the empty memcg case, the helper function shrink_memcg() is
> modified to check if the memcg is empty and then return -ENOENT.
>
> Fixes: a65b0e7607cc ("zswap: make shrinking memcg-aware")
> Signed-off-by: Takero Funaki <flintglass@...il.com>

Nice! LGTM FWIW.
Reviewed-by: Nhat Pham <nphamcs@...il.com>

Thank you so much for working on this, Takero! I look forward to your
other global shrinker fixes :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ