summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorYe Liu <liuye@kylinos.cn>2025-03-25 15:38:03 +0800
committerAndrew Morton <akpm@linux-foundation.org>2025-05-11 17:48:08 -0700
commit26d4d18b79659054e451be9487937e31e63d0853 (patch)
treecde8c434f0f68d36010e7bfa0d7f7bdd980b0124 /tools/perf/scripts/python/bin
parent2e976567233228ff928c2405f7e03ebb7fb7aa50 (diff)
downloadlinux-26d4d18b79659054e451be9487937e31e63d0853.tar.gz
linux-26d4d18b79659054e451be9487937e31e63d0853.zip
mm/show_mem: optimize si_meminfo_node by reducing redundant code
Refactors the si_meminfo_node() function by reducing redundant code and improving readability. Moved the calculation of managed_pages inside the existing loop that processes pgdat->node_zones, eliminating the need for a separate loop. Simplified the logic by removing unnecessary preprocessor conditionals. Ensured that both totalram, totalhigh, and other memory statistics are consistently set without duplication. This change results in cleaner and more efficient code without altering functionality. Link: https://lkml.kernel.org/r/20250325073803.852594-1-ye.liu@linux.dev Signed-off-by: Ye Liu <liuye@kylinos.cn> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Reviewed-by: Harry Yoo <harry.yoo@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions