All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch added to mm-unstable branch
@ 2023-09-22  1:40 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-09-22  1:40 UTC (permalink / raw)
  To: mm-commits, sj, link, akpm


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@vivo.com>
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@vivo.com
Signed-off-by: Huan Yang <link@vivo.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@vivo.com are

mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-22  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22  1:40 + mm-damon-core-remove-unnecessary-si_meminfo-invoke.patch added to mm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.