The patch titled Subject: mm/damon/core: remove unnecessary si_meminfo invoke. has been added to the -mm mm-unstable branch. Its filename is mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Huan Yang <link@xxxxxxxx> Subject: mm/damon/core: remove unnecessary si_meminfo invoke. Date: Wed, 20 Sep 2023 09:57:27 +0800 si_meminfo() will read and assign more info not just free/ram pages. For just DAMOS_WMARK_FREE_MEM_RATE use, only get free and ram pages is ok to save cpu. Link: https://lkml.kernel.org/r/20230920015727.4482-1-link@xxxxxxxx Signed-off-by: Huan Yang <link@xxxxxxxx> Reviewed-by: SeongJae Park <sj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/damon/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/mm/damon/core.c~mm-damon-core-remove-unnecessary-si_meminfo-invoke +++ a/mm/damon/core.c @@ -1326,12 +1326,10 @@ static bool kdamond_need_stop(struct dam static unsigned long damos_wmark_metric_value(enum damos_wmark_metric metric) { - struct sysinfo i; - switch (metric) { case DAMOS_WMARK_FREE_MEM_RATE: - si_meminfo(&i); - return i.freeram * 1000 / i.totalram; + return global_zone_page_state(NR_FREE_PAGES) * 1000 / + totalram_pages(); default: break; } _ Patches currently in -mm which might be from link@xxxxxxxx are mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch