aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorYosry Ahmed <[email protected]>2023-04-28 13:24:05 +0000
committerAndrew Morton <[email protected]>2023-06-09 23:25:13 +0000
commit5b42360c73b0679505dac6ec44d234cfec61120c (patch)
tree2d504165e62cb18e3bcb5654b85c518b5c19e291 /mm/page_alloc.c
parentmigrate_pages: avoid blocking for IO in MIGRATE_SYNC_LIGHT (diff)
downloadkernel-5b42360c73b0679505dac6ec44d234cfec61120c.tar.gz
kernel-5b42360c73b0679505dac6ec44d234cfec61120c.zip
memcg: use seq_buf_do_printk() with mem_cgroup_print_oom_meminfo()
Currently, we format all the memcg stats into a buffer in mem_cgroup_print_oom_meminfo() and use pr_info() to dump it to the logs. However, this buffer is large in size. Although it is currently working as intended, ther is a dependency between the memcg stats buffer and the printk record size limit. If we add more stats in the future and the buffer becomes larger than the printk record size limit, or if the prink record size limit is reduced, the logs may be truncated. It is safer to use seq_buf_do_printk(), which will automatically break up the buffer at line breaks and issue small printk() calls. Refactor the code to move the seq_buf from memory_stat_format() to its callers, and use seq_buf_do_printk() to print the seq_buf in mem_cgroup_print_oom_meminfo(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Yosry Ahmed <[email protected]> Acked-by: Michal Hocko <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Acked-by: Shakeel Butt <[email protected]> Reviewed-by: Muchun Song <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Steven Rostedt (Google) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/page_alloc.c')
0 files changed, 0 insertions, 0 deletions