linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com
Cc: akpm@linux-foundation.org, cgroups@vger.kernel.org,
	linux-mm@kvack.org, shaoyafang@didiglobal.com,
	Yafang Shao <laoar.shao@gmail.com>
Subject: [PATCH] mm/memcontrol: split pgscan into direct and kswapd for memcg
Date: Tue,  9 Apr 2019 21:13:43 +0800	[thread overview]
Message-ID: <1554815623-9353-1-git-send-email-laoar.shao@gmail.com> (raw)

Now we count PGSCAN_KSWAPD and PGSCAN_DIRECT into one single item
'pgscan', that's not proper.

PGSCAN_DIRECT is triggered by the tasks in this memcg, which directly
indicates the memory status of this memcg;
while PGSCAN_KSWAPD is triggered by the kswapd(which always reflects the
system level memory status) and it happens to scan the pages in this
memcg.

So we should better split 'pgscan' into 'pgscan_direct' and
'pgscan_kswapd'.

BTW, softlimit reclaim will never happen in cgroup v2.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 mm/memcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 10af4dd..abd17f8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5635,8 +5635,8 @@ static int memory_stat_show(struct seq_file *m, void *v)
 		   acc.vmstats[WORKINGSET_NODERECLAIM]);
 
 	seq_printf(m, "pgrefill %lu\n", acc.vmevents[PGREFILL]);
-	seq_printf(m, "pgscan %lu\n", acc.vmevents[PGSCAN_KSWAPD] +
-		   acc.vmevents[PGSCAN_DIRECT]);
+	seq_printf(m, "pgscan_direct %lu\n", acc.vmevents[PGSCAN_DIRECT]);
+	seq_printf(m, "pgscan_kswapd %lu\n", acc.vmevents[PGSCAN_KSWAPD]);
 	seq_printf(m, "pgsteal %lu\n", acc.vmevents[PGSTEAL_KSWAPD] +
 		   acc.vmevents[PGSTEAL_DIRECT]);
 	seq_printf(m, "pgactivate %lu\n", acc.vmevents[PGACTIVATE]);
-- 
1.8.3.1


             reply	other threads:[~2019-04-09 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 13:13 Yafang Shao [this message]
2019-04-09 13:25 ` [PATCH] mm/memcontrol: split pgscan into direct and kswapd for memcg Chris Down
2019-04-09 14:04   ` Yafang Shao
2019-04-09 17:55 ` Johannes Weiner
2019-04-10  1:16   ` Yafang Shao

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=1554815623-9353-1-git-send-email-laoar.shao@gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=shaoyafang@didiglobal.com \
    --cc=vdavydov.dev@gmail.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;
as well as URLs for NNTP newsgroup(s).