public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hao Lee <haolee.swjtu@gmail.com>
To: akpm@linux-foundation.org
Cc: hannes@cmpxchg.org, shakeelb@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, haolee.swjtu@gmail.com
Subject: [PATCH] mm: vmscan: consistent update to pgdeactivate and pgactivate
Date: Thu, 19 Aug 2021 16:30:56 +0000	[thread overview]
Message-ID: <20210819163056.GA9764@haolee.github.io> (raw)

After the commit 912c05720f00 ("mm: vmscan: consistent update to
pgrefill"), pgrefill is consistent with pgscan and pgsteal. Only under
global reclaim, are they updated at system level. Apart from that,
pgdeactivate is often used together with pgrefill to measure the
deactivation efficiency and pgactivate is used together with
pgscan to measure the reclaim efficiency. It's also necessary to
make pgdeactivate and pgactivate consistent with this rule.

Signed-off-by: Hao Lee <haolee@didiglobal.com>
---
 mm/vmscan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 403a175a720f..9242c01d03ac 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1814,7 +1814,8 @@ static unsigned int shrink_page_list(struct list_head *page_list,
 	free_unref_page_list(&free_pages);
 
 	list_splice(&ret_pages, page_list);
-	count_vm_events(PGACTIVATE, pgactivate);
+	if (!cgroup_reclaim(sc))
+		count_vm_events(PGACTIVATE, pgactivate);
 
 	return nr_reclaimed;
 }
@@ -2427,7 +2428,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
 	/* Keep all free pages in l_active list */
 	list_splice(&l_inactive, &l_active);
 
-	__count_vm_events(PGDEACTIVATE, nr_deactivate);
+	if (!cgroup_reclaim(sc))
+		__count_vm_events(PGDEACTIVATE, nr_deactivate);
 	__count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate);
 
 	__mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken);
-- 
2.31.1


             reply	other threads:[~2021-08-19 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 16:30 Hao Lee [this message]
2021-08-19 20:26 ` [PATCH] mm: vmscan: consistent update to pgdeactivate and pgactivate Shakeel Butt
2021-08-20  6:53   ` Hao Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210819163056.GA9764@haolee.github.io \
    --to=haolee.swjtu@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeelb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox