linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
@ 2021-01-04  5:03 Hugh Dickins
  2021-01-04  8:11 ` Alex Shi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Hugh Dickins @ 2021-01-04  5:03 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Hui Su, Alex Shi, Lorenzo Stoakes, Michal Hocko, Johannes Weiner,
	Shakeel Butt, Roman Gushchin, linux-kernel, linux-mm

Boot a CONFIG_MEMCG=y kernel with "cgroup_disabled=memory" and you are
met by a series of warnings from the VM_WARN_ON_ONCE_PAGE(!memcg, page)
recently added to the inline mem_cgroup_page_lruvec().

An earlier attempt to place that warning, in mem_cgroup_lruvec(), had
been careful to do so after weeding out the mem_cgroup_disabled() case;
but was itself invalid because of the mem_cgroup_lruvec(NULL, pgdat) in
clear_pgdat_congested() and age_active_anon().

Warning in mem_cgroup_page_lruvec() was once useful in detecting a KSM
charge bug, so may be worth keeping: but skip if mem_cgroup_disabled().

Fixes: 9a1ac2288cf1 ("mm/memcontrol:rewrite mem_cgroup_page_lruvec()")
Signed-off-by: Hugh Dickins <hughd@google.com>
---

 include/linux/memcontrol.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 5.11-rc2/include/linux/memcontrol.h	2020-12-27 20:39:36.751923135 -0800
+++ linux/include/linux/memcontrol.h	2021-01-03 19:38:24.822978559 -0800
@@ -665,7 +665,7 @@ static inline struct lruvec *mem_cgroup_
 {
 	struct mem_cgroup *memcg = page_memcg(page);
 
-	VM_WARN_ON_ONCE_PAGE(!memcg, page);
+	VM_WARN_ON_ONCE_PAGE(!memcg && !mem_cgroup_disabled(), page);
 	return mem_cgroup_lruvec(memcg, pgdat);
 }
 

^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <alpine.LSU.2.11.2101032107230.1158@eggly.anvils>]

end of thread, other threads:[~2021-01-09  2:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04  5:03 [PATCH] mm/memcontrol: fix warning in mem_cgroup_page_lruvec() Hugh Dickins
2021-01-04  8:11 ` Alex Shi
2021-01-06  6:49 ` Baoquan He
2021-01-06 19:33   ` Andrew Morton
2021-01-06 19:35   ` Andrew Morton
2021-01-07  2:53     ` Baoquan He
2021-01-06 16:19 ` Chris Down
2021-01-07 18:04 ` Vlastimil Babka
2021-01-09  2:23   ` Hugh Dickins
     [not found] <alpine.LSU.2.11.2101032107230.1158@eggly.anvils>
2021-01-04 18:09 ` Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).