[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260110153342.7e689e794ce43a0a39c699fc@linux-foundation.org>
Date: Sat, 10 Jan 2026 15:33:42 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jianyue Wu <wujianyue000@...il.com>
Cc: linux-mm@...ck.org, cgroups@...r.kernel.org, hannes@...xchg.org,
mhocko@...nel.org, roman.gushchin@...ux.dev, shakeel.butt@...ux.dev,
muchun.song@...ux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm: optimize stat output for 11% sys time reduce
On Sat, 10 Jan 2026 12:22:49 +0800 Jianyue Wu <wujianyue000@...il.com> wrote:
> Replace seq_printf/seq_buf_printf with lightweight helpers to avoid
> printf parsing in memcg stats output.
>
> Key changes:
> - Add memcg_seq_put_name_val() for seq_file "name value\n" formatting
> - Add memcg_seq_buf_put_name_val() for seq_buf "name value\n" formatting
> - Update __memory_events_show(), swap_events_show(),
> memory_stat_format(), memory_numa_stat_show(), and related helpers
> - Introduce local variables to improve readability and reduce line length
>
> Performance:
> - 1M reads of memory.stat+memory.numa_stat
> - Before: real 0m9.663s, user 0m4.840s, sys 0m4.823s
> - After: real 0m9.051s, user 0m4.775s, sys 0m4.275s (~11.4% sys drop)
>
> Tests:
> - Script:
> for ((i=1; i<=1000000; i++)); do
> : > /dev/null < /sys/fs/cgroup/memory.stat
> : > /dev/null < /sys/fs/cgroup/memory.numa_stat
> done
I don't understand - your previous email led me to believe that the new
BPF interface can be used to address this issue?
Powered by blists - more mailing lists