Skip to contentSkip to conversation

mm-zswap-fix-zswap_never_enabled-for-config_zswap==n.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled

     Subject: mm: zswap: fix zswap_never_enabled() for CONFIG_ZSWAP==N
has been removed from the -mm tree.  Its filename was
     mm-zswap-fix-zswap_never_enabled-for-config_zswap==n.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Barry Song <[email protected]>
Subject: mm: zswap: fix zswap_never_enabled() for CONFIG_ZSWAP==N
Date: Sun, 30 Jun 2024 11:22:31 +1200

If CONFIG_ZSWAP is set to N, it means zswap cannot be enabled. zswap_never_enabled() should return true.

The only effect of this issue is that with Barry's latest large folio swapin patches for zram ("mm: support mTHP swap-in for zRAM-like swapfile"), we will always fallback to order-0 swapin, even mistakenly when !CONFIG_ZSWAP.

Basically this bug makes Barry's in progress patches not work at all.

The API was created to inform the mm core that zswap has never been enabled, allowing the mm core to perform mTHP swap-in. This is a transitional solution until zswap supports mTHP. If zswap has been enabled, performing mTHP swap-in will result in corrupted data. You may find the answer in the mTHP swap-in series:

https://lore.kernel.org/linux-mm/CAJD7tkZ4FQr6HZpduOdvmqgg_-whuZYE-Bz5O2t6yzw6Yg+v1A@mail.gmail.com/

---

 include/linux/zswap.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/zswap.h renamed from include/linux/zswap.h~mm-zswap-fix-zswap_never_enabled-for-config_zswap==n +1 -1
@@ -68,7 +68,7 @@ static inline bool zswap_is_enabled(void
 
 static inline bool zswap_never_enabled(void)
 {
-	return false;
+	return true;
 }
 
 #endif

_

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