Skip to contentSkip to conversation

zswap-add-allocation-hysteresis-if-pool-limit-is-hit.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 31, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/zswap.c: add allocation hysteresis if pool limit is hit
has been removed from the -mm tree. Its filename was
zswap-add-allocation-hysteresis-if-pool-limit-is-hit.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Vitaly Wool <[email protected]>
Subject: mm/zswap.c: add allocation hysteresis if pool limit is hit

zswap will always try to shrink pool when zswap is full. If there is a high pressure on zswap it will result in flipping pages in and out zswap pool without any real benefit, and the overall system performance will drop. The previous discussion on this subject [1] ended up with a suggestion to implement a sort of hysteresis to refuse taking pages into zswap pool until it has sufficient space if the limit has been hit. This is my take on this.

Hysteresis is controlled with a sysfs-configurable parameter (namely, /sys/kernel/debug/zswap/accept_threhsold_percent). It specifies the threshold at which zswap would start accepting pages again after it became full. Setting this parameter to 100 disables the hysteresis and sets the zswap behavior to pre-hysteresis state.

[1] https://lkml.org/lkml/2019/11/8/949

---

 Documentation/vm/zswap.rst |   13 +++++
 mm/zswap.c                 |   85 ++++++++++++++++++++++-------------
 2 files changed, 67 insertions(+), 31 deletions(-)
Documentation/vm/zswap.rst renamed from Documentation/vm/zswap.rst~zswap-add-allocation-hysteresis-if-pool-limit-is-hit +13 -0
@@ -130,6 +130,19 @@ checking for the same-value filled pages
 existing pages which are marked as same-value filled pages remain stored
 unchanged in zswap until they are either loaded or invalidated.
 
+To prevent zswap from shrinking pool when zswap is full and there's a high
+pressure on swap (this will result in flipping pages in and out zswap pool
+without any real benefit but with a performance drop for the system), a
+special parameter has been introduced to implement a sort of hysteresis to
+refuse taking pages into zswap pool until it has sufficient space if the limit
+has been hit. To set the threshold at which zswap would start accepting pages
+again after it became full, use the sysfs ``accept_threhsold_percent``
+attribute, e. g.::
+
+	echo 80 > /sys/module/zswap/parameters/accept_threhsold_percent
+
+Setting this parameter to 100 will disable the hysteresis.
+
 A debugfs interface is provided for various statistic about pool size, number
 of pages stored, same-value filled pages and various counters for the reasons
 pages are rejected.
mm/zswap.c renamed from mm/zswap.c~zswap-add-allocation-hysteresis-if-pool-limit-is-hit +54 -31

166 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are