linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mm: memcg: remove redundant seq_buf_has_overflowed()
@ 2024-06-26  9:42 Xiu Jianfeng
  2024-06-27  7:13 ` Michal Hocko
  0 siblings, 1 reply; 12+ messages in thread
From: Xiu Jianfeng @ 2024-06-26  9:42 UTC (permalink / raw)
  To: hannes, mhocko, roman.gushchin, shakeel.butt, muchun.song, akpm
  Cc: cgroups, linux-mm, linux-kernel

Both the end of memory_stat_format() and memcg_stat_format() will call
WARN_ON_ONCE(seq_buf_has_overflowed()). However, memory_stat_format()
is the only caller of memcg_stat_format(), when memcg is on the default
hierarchy, seq_buf_has_overflowed() will be executed twice, so remove
the reduntant one.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 mm/memcontrol.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 974bd160838c..776d22bc66a2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1846,9 +1846,6 @@ static void memcg_stat_format(struct mem_cgroup *memcg, struct seq_buf *s)
 			       vm_event_name(memcg_vm_event_stat[i]),
 			       memcg_events(memcg, memcg_vm_event_stat[i]));
 	}
-
-	/* The above should easily fit into one page */
-	WARN_ON_ONCE(seq_buf_has_overflowed(s));
 }
 
 static void memcg1_stat_format(struct mem_cgroup *memcg, struct seq_buf *s);
-- 
2.34.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-06-28  7:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  9:42 [PATCH -next] mm: memcg: remove redundant seq_buf_has_overflowed() Xiu Jianfeng
2024-06-27  7:13 ` Michal Hocko
2024-06-27  8:33   ` xiujianfeng
2024-06-27 11:20     ` Michal Hocko
2024-06-27 11:43       ` xiujianfeng
2024-06-27 11:54         ` Michal Hocko
2024-06-28  2:20           ` xiujianfeng
2024-06-28  7:09             ` Michal Hocko
2024-06-27 11:33   ` Yosry Ahmed
2024-06-27 11:56     ` Michal Hocko
2024-06-27 12:00       ` Yosry Ahmed
2024-06-27 12:28         ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox