[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250818184644.3679904-1-shakeel.butt@linux.dev>
Date: Mon, 18 Aug 2025 11:46:44 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>,
Boris Burkov <boris@....io>,
linux-btrfs@...r.kernel.org,
linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org,
cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org,
Meta kernel team <kernel-team@...a.com>
Subject: [PATCH] memcg: remove warning from folio_lruvec
Commit a4055888629bc ("mm/memcg: warning on !memcg after readahead page
charged") added the warning in folio_lruvec (older name was
mem_cgroup_page_lruvec) for !memcg when charging of readahead pages were
added to the kernel. Basically lru pages on a memcg enabled system were
always expected to be charged to a memcg.
However a recent functionality to allow metadata of btrfs, which is in
page cache, to be uncharged is added to the kernel. We can either change
the condition to only check anon pages or file pages which does not have
AS_UNCHARGED in their mapping. Instead of such complicated check, let's
just remove the warning as it is not really helpful anymore.
Closes: https://ci.syzbot.org/series/15fd2538-1138-43c0-b4d6-6d7f53b0be69
Signed-off-by: Shakeel Butt <shakeel.butt@...ux.dev>
---
include/linux/memcontrol.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9fa3afc90dd5..fae105a9cb46 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -729,10 +729,7 @@ static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
*/
static inline struct lruvec *folio_lruvec(struct folio *folio)
{
- struct mem_cgroup *memcg = folio_memcg(folio);
-
- VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio);
- return mem_cgroup_lruvec(memcg, folio_pgdat(folio));
+ return mem_cgroup_lruvec(folio_memcg(folio), folio_pgdat(folio));
}
struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
--
2.47.3
Powered by blists - more mailing lists