Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: memcg: adjust the warning when seq_buf overflows

Currently it uses WARN_ON_ONCE() if seq_buf overflows when user reads
memory.stat, the only advantage of WARN_ON_ONCE is that the splat is so
verbose that it gets noticed. And also it panics the system if
panic_on_warn is enabled. It seems like the warning is just an over
reaction and a simple pr_warn should just achieve the similar effect.

Link: https://lkml.kernel.org/r/20240628072333.2496527-1-xiujianfeng@huawei.com
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Suggested-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Xiu Jianfeng and committed by
Andrew Morton
c2fad56b 1c46cc09

+2 -1
+2 -1
mm/memcontrol.c
··· 1484 1484 memcg_stat_format(memcg, s); 1485 1485 else 1486 1486 memcg1_stat_format(memcg, s); 1487 - WARN_ON_ONCE(seq_buf_has_overflowed(s)); 1487 + if (seq_buf_has_overflowed(s)) 1488 + pr_warn("%s: Warning, stat buffer overflow, please report\n", __func__); 1488 1489 } 1489 1490 1490 1491 /**