From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796189917; b=TPHPA8bsPEL2aWDe30xCm5sgi8iyrkCtSr6QJxXCkHGOqf48kMlu1/HIpZxA/QRK8tpl h9wH8cKM0PZhQQeG7Mhc5+OZiiFkXqtpLJpiD8fG3LW8vZO2G7tWyYRRZKaQ8yhn4oCJE jWN4ITOw6Z10q9jY2on5YKlfWpbNoSQ8+BBml7XeMSCWNCdHHbDvFBOSQk2n4a+6WL372 GpOhZ4vWGlhH5KtD+244qgf8LnNWqtjAyChuUI+1ABzem1azpCYxmYH7YreXrCWevrITv U8d59imW33l7nM79MsX1Dbi/Bcolxnx5DMN3nXMC/HNIzDp1kd2luCbgvVYMnyrTFaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796189917; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=cSHPBYnZNG2wfYUsD5K645Llu7zQ6V4Im7ATSnnhjBA=; b=vgKBykb1sU46OWDHC4EZW2jEPl/2z/3X8GnnOsoHrp0Fx2rGpdjdJZRsx3dK63J3xZIY Ff3WLC/7E1mMUmyqrS8n273VhGuxVP0fLWFERQCJ6GoN5tztwa3N6Fv1NPKW+FVeINNcw vFOjLo3nfqqszNkmkSsB/frCqIMQcfjN4IhAwlbZvQyRtoLUAxWWtgPY9GCuPpL/at9Iv pPaxIHAW7cZmrT0R0L5xxYPIsHz2jrzlwbzHK+ZCCQKntjHBaq2a0J/s4p9ox3XZ2yECB rE85h0k2j6GzKz+7JZltWTT0Tf6eXDSahmgLeJazBLlBKXegm4+hpiJ6rwGODj7pG4Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lV70r6CV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 446AA606A31A for ; Wed, 2 Dec 2026 05:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lV70r6CV Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAEB41F00893; Wed, 2 Dec 2026 05:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796189916; bh=cSHPBYnZNG2wfYUsD5K645Llu7zQ6V4Im7ATSnnhjBA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=lV70r6CV019JtynWWonEUYn+Q/wDRPXWHCd23/HnHjZPyMreqrOzZ0VJQa3gNljUO myawwfJQS8hm452gzM51EfVzp+B4AOmFG5+FNjOouYcobcehwzXofAhTFBQQnyaDFO P1IvrOQ7I1TU8H0ThUw9i3f7WKYJJthvPnAkjeu5qHTawSWhd7n0FBKJm7EFDVnCnD uCo2Q1sX8lnJ0EMNquzvE7hlsoVrHlK2k1igmix2PPRnsq5AReJgKB+FcnI+aOiwLA ovZyoxDWEM/KzvrRDJhIIuVDeP8ZnbhEoFotaE1R9fVzYVOlGi1NCL915QkBrMh2sG aBRbmVANrMIAQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 5/9] mm: zswap: Store the folio's node id in the zswap_entry. Reply-To: sashiko-reviews@lists.linux.dev To: "Kanchana P. Sridhar" , hannes@cmpxchg.org, yosry@kernel.org, nphamcs@gmail.com, chengming.zhou@linux.dev, akpm@linux-foundation.org, linux-mm@kvack.org, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org Cc: rientjes@google.com, willy@infradead.org, senozhatsky@chromium.org In-Reply-To: <20261201053711.8090-6-kanchanapsridhar2026@gmail.com> References: <20261201053711.8090-1-kanchanapsridhar2026@gmail.com> <20261201053711.8090-6-kanchanapsridhar2026@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 05:38:35 +0000 X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] mm: zswap: shrink_memcg() skips non-N_NORMAL_MEMORY nodes in zswap_list_lru -- commit 3dca6b735f1c7e1dee1dc2d9901ad7cbacbdefc6 Author: Kanchana P. Sridhar mm: zswap: Store the folio's node id in the zswap_entry. This commit stores the folio's NUMA node ID in struct zswap_entry for list_lru indexing and makes zswap_entry slab allocations node-agnostic. > diff --git a/mm/zswap.c b/mm/zswap.c > index 9ee20b576eff8..cdca497ef8dbb 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c [ ... ] > @@ -680,14 +685,8 @@ static int zswap_enabled_param_set(const char *val, > * lru functions > **********************************/ > =20 > -static inline int entry_to_nid(struct zswap_entry *entry) > -{ > - return page_to_nid(virt_to_page(entry)); > -} > - > static void zswap_lru_add(struct zswap_entry *entry) > { > - int nid =3D entry_to_nid(entry); > struct mem_cgroup *memcg; > =20 > /* > @@ -704,19 +703,18 @@ static void zswap_lru_add(struct zswap_entry *entry) > rcu_read_lock(); > memcg =3D obj_cgroup_memcg(entry->objcg); > /* will always succeed */ > - list_lru_add(&zswap_list_lru, &entry->lru, nid, memcg); > + list_lru_add(&zswap_list_lru, &entry->lru, entry->nid, memcg); > rcu_read_unlock(); > } [ ... ] > @@ -1537,9 +1536,10 @@ static bool zswap_store_page(struct folio *folio, = long index, > { > swp_entry_t page_swpentry =3D folio_swap_entry(folio, index); > struct zswap_entry *entry, *old; > + int nid =3D folio_nid(folio); > =20 > /* allocate entry */ > - entry =3D zswap_entry_cache_alloc(GFP_KERNEL, folio_nid(folio)); > + entry =3D zswap_entry_cache_alloc(GFP_KERNEL); > if (!entry) { > zswap_reject_kmemcache_fail++; > return false; > @@ -1554,6 +1554,7 @@ static bool zswap_store_page(struct folio *folio, l= ong index, > * to an unrelated live pool. > */ > entry->pool_idx =3D pool->idx; > + entry->nid =3D nid; [Severity: Medium] Can shrink_memcg() miss zswap entries queued on nodes without normal memory? Previously, entry_to_nid() derived the list_lru node ID from the GFP_KERNEL slab page backing struct zswap_entry, so entries were always queued on a node in N_NORMAL_MEMORY. Now entry->nid is set to folio_nid(folio), which for movable user folios can be a node in N_MEMORY that has only ZONE_MOVABLE (such as a CXL memory-tier node or hotplugged movable node) and is not in N_NORMAL_MEMORY. However, shrink_memcg() only walks N_NORMAL_MEMORY nodes: mm/zswap.c:shrink_memcg() { ... for_each_node_state(nid, N_NORMAL_MEMORY) { unsigned long nr_to_walk =3D SWAP_CLUSTER_MAX; shrunk +=3D list_lru_walk_one(&zswap_list_lru, nid, memcg, &shrink_memcg_cb, &ctl, &nr_to_walk); scanned +=3D SWAP_CLUSTER_MAX - nr_to_walk; } ... } As a result, both per-memcg and global zswap pool limit reclaim in shrink_memcg() will skip entries originating from non-N_NORMAL_MEMORY nodes. Should shrink_memcg() iterate over N_MEMORY instead? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201053711.8090= -1-kanchanapsridhar2026@gmail.com?part=3D5