mirror of
https://github.com/torvalds/linux
synced 2024-09-16 00:58:07 +00:00
mm/damon/core: remove unnecessary si_meminfo invoke.
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>
This commit is contained in:
parent
8c9ae56dc7
commit
987ffa5a38
|
@ -1326,12 +1326,10 @@ static bool kdamond_need_stop(struct damon_ctx *ctx)
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue