From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF8D13BCD16 for ; Thu, 6 Aug 2026 07:09:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786000199; cv=none; b=rt5dTdaWr6G7gJ24ZqmogRD2HDnkfOdKO3IXOk7AoKI5YAfa7PQYBWnE1Dhp2sxYGXzRbPBPF40rR7m/iqP1XdmAjPdNyuC6y3EF3AnBfxKCflDdmZs3xwz7tR8c5xVyX74I8onW+T3DTES6/1+6Tpjql30Ti2NE6qjObotAoJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786000199; c=relaxed/simple; bh=KB/jB6OqWEcRCtVeInMUBakqguBclC5RDAHwxdTvA14=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=DBz3rDRl45/ARou4oUSjl5YrcSj4aL2xETdVypaYyYzy9XIULC5M0qUZ/0QFHykWQo9Mfk2UJ5/mq6hmtWqRPJXI3aqtM882Rq4yoPBDVfgPOHuZi2mkcZdreGN2bAXn2qaJ5qkwhQE7e0Vf2pzVK9DrbX2eS8x06hh8xLximd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=it0YtjD3; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="it0YtjD3" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-84e3007a2b7so1726012b3a.0 for ; Thu, 06 Aug 2026 00:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786000197; x=1786604997; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=2rWnIhKLtx7RMjDuQwqgCN4If/Fil+88btYo9NiRc0M=; b=it0YtjD3GvRnyc2JpTyu4GZQQ1kiIU0+Tsb2Q4RZCxnmVs2vKx45u29vyf13oFjkWg aCy/Y5qLpWI564umd5WWuePxlbwxpsQMkv100mbDMGQz61s9MsQ/ii/YvpCrFyzVxdi4 phPKjS6QazkOq5cc63hko5e4h4d+1DY8Ls36tzMQFGc2rfeBeuHzJbxmgfblN34kuUux EzhQUXbtc/JIzbVCs2BoTveEHfkB0Zl+UO5VejiAP/vxmhQbApwNZz9ejcOOWbVNK4Qo RbQkGET2QdjDdOqZ/cQqwpdzejVF6mMC5PHlapRMrODVAa4c99KaiBDRhYvVew/GxEj/ YduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786000197; x=1786604997; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2rWnIhKLtx7RMjDuQwqgCN4If/Fil+88btYo9NiRc0M=; b=pcb5IzoJXm1KnotB2Sx6htiKalPH9lfz668KkfVSglv2A9U0HFDbVwo5r7NjPzj9vb AdPzpms2Ut4YyrQ73eTw8Qgq9q360sNT1kv7/rza1mEbJaBHEE96rzqIeLWroyRz+g0k ujdrWBUTeaN9/Elx64N+1U3nKaHso6P29vK41n1LbPSHs7euocLKrE9x2stuuwtL3hIZ 6de5RVNdlIEOM5JkSjuSyBE/W+pBVb7LBz6TJx+LcHnXJW1C5evBVm5WiHk6/h/gzh8c +044Fd75+DRcN/++iBKGK5z5+Jd8Lf0Pp6Vjw8yxNHfQm8z+tw+SPWpzD5kHkADCsKRL r26w== X-Forwarded-Encrypted: i=1; AHgh+Rqgox3oltebJOnpC7mB+IN4Ioy/iBe+R48AwRsh6cNCLHzl+4WBUz7DrrwBFgXw4MbcUfZM68oBfqR+W7w=@vger.kernel.org X-Gm-Message-State: AOJu0YxyL3KhC0+gKh8ah7pL4DgK4oudGSdS9sM5vTxO6j5JgEbIgRgZ ENk3JNmtd0+d4H5kZjIRMi7oDkOhuhCPg+G6A2pnjHW8Ae4iVO1BG2vG X-Gm-Gg: AR+sD12zqlQG2e/a6CRglf562bK/KKRDuovzB3tjnEpNdr4EkP1VNLszFuexsP7rsJ8 gsDrgVg8uijKSlHwSfWv3yPi7J5vDVdu+EFQ8iiSJAc5Q0e62gbDraXSwESs6Idl17oEbz0iPrE 4A8D1oooaPtYCuGxD8/RU7p5fa19gHkW2V0DSV0WlEyfD0c4oCoJFv5qVeIabB7E3XH64aE9FyS /ZVApdhHXRXgYrgSUkZvTh2SofwBOEvhUQ5G9VYkwY4f0hnlWXWAUmDYNJQLMk3bmPL+XOAf7AC /t3Q05TZ5PNCen7HgcYjqvGXsF9dZewLyjuk+OESZk4Ftvy8VlyK03msYXEtCc0oyVzcVD0tOIN Kno+OJNHMHG+ATgtWHi74FUc4xbmkNbXUcEOQxgfrdgmRvMSB86aKdrU9jO0qAlVZxrDYcRREJJ i9b13/jQzVAhKw96WFpYePgPAsCbwFQQjFEOLpT2W7NZP94YQUQWAWZAsztVajkZLusU/zXLqyL EwhkrrAhYNDMwUM X-Received: by 2002:a05:6a00:3d54:b0:847:8b1d:230d with SMTP id d2e1a72fcca58-84f2e014151mr13785011b3a.3.1786000197171; Thu, 06 Aug 2026 00:09:57 -0700 (PDT) Received: from localhost.localdomain ([210.184.73.204]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84f45bc9cffsm760154b3a.59.2026.08.06.00.09.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Aug 2026 00:09:56 -0700 (PDT) From: Hao Jia To: akpm@linux-foundation.org, tj@kernel.org, hannes@cmpxchg.org, shakeel.butt@linux.dev, mhocko@kernel.org, yosry@kernel.org, mkoutny@suse.com, nphamcs@gmail.com, chengming.zhou@linux.dev, muchun.song@linux.dev, roman.gushchin@linux.dev Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Hao Jia Subject: [PATCH v4 0/2] mm/zswap: Fixes and improves the zswap shrink Date: Thu, 6 Aug 2026 15:09:41 +0800 Message-Id: <20260806070943.95542-1-jiahao.kernel@gmail.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Hao Jia This series fixes and improves the zswap global shrinker (shrink_worker()): Patch 1: Fix missing global shrinker when memory cgroup is disabled. Patch 2: Extend shrink_memcg() to support batch writeback and thereby improving the writeback efficiency in the shrink_worker() and zswap_store() paths. v3->v4: - Remove the nr_to_scan parameter from shrink_memcg() and cap the per-node scan count at SWAP_CLUSTER_MAX to avoid writeback unfairness across NUMA nodes caused by a shared global scan quota. v2->v3: - Added user impact to the commit 1 message. - Updated writeback batch size to SWAP_CLUSTER_MAX to avoid introducing new magic macros. And enabled batched shrinking in the zswap_store() path as well. - Re-benchmarked performance data with the updated patch. v1->v2: - Add a reschedule check to the -ENOENT return path in shrink_memcg() to handle the theoretical issue of prolonged heavy concurrent zswap stores. - Remove the shrink_memcg() return value changes part, and include a more detailed test report in the commit message. [v3] https://lore.kernel.org/all/20260729084206.77793-1-jiahao.kernel@gmail.com [v2] https://lore.kernel.org/all/20260717085151.22822-1-jiahao.kernel@gmail.com [v1] https://lore.kernel.org/all/20260714081510.16895-1-jiahao.kernel@gmail.com Hao Jia (2): mm/zswap: Fix global shrinker when memory cgroup is disabled mm/zswap: Support batch writeback in shrink_memcg() mm/zswap.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) -- 2.34.1