[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210715055145.195411-6-ying.huang@intel.com>
Date: Thu, 15 Jul 2021 13:51:41 +0800
From: Huang Ying <ying.huang@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Yang Shi <yang.shi@...ux.alibaba.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
Yang Shi <shy828301@...il.com>, Wei Xu <weixugc@...gle.com>,
Michal Hocko <mhocko@...e.com>, Zi Yan <ziy@...dia.com>,
David Rientjes <rientjes@...gle.com>,
Dan Williams <dan.j.williams@...el.com>,
David Hildenbrand <david@...hat.com>,
osalvador <osalvador@...e.de>
Subject: [PATCH -V10 5/9] mm/vmscan: add page demotion counter
From: Yang Shi <yang.shi@...ux.alibaba.com>
Account the number of demoted pages.
Add pgdemote_kswapd and pgdemote_direct VM counters showed in
/proc/vmstat.
[ daveh:
- __count_vm_events() a bit, and made them look at the THP
size directly rather than getting data from migrate_pages()
]
Signed-off-by: Yang Shi <yang.shi@...ux.alibaba.com>
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
Reviewed-by: Yang Shi <shy828301@...il.com>
Reviewed-by: Wei Xu <weixugc@...gle.com>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Zi Yan <ziy@...dia.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: osalvador <osalvador@...e.de>
--
Changes since 202010:
* remove unused scan-control 'demoted' field
---
include/linux/vm_event_item.h | 2 ++
mm/vmscan.c | 5 +++++
mm/vmstat.c | 2 ++
3 files changed, 9 insertions(+)
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index ae0dd1948c2b..a185cc75ff52 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -33,6 +33,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
PGREUSE,
PGSTEAL_KSWAPD,
PGSTEAL_DIRECT,
+ PGDEMOTE_KSWAPD,
+ PGDEMOTE_DIRECT,
PGSCAN_KSWAPD,
PGSCAN_DIRECT,
PGSCAN_DIRECT_THROTTLE,
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 6ca6baa09c81..35913e35369d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1316,6 +1316,11 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
target_nid, MIGRATE_ASYNC, MR_DEMOTION,
&nr_succeeded);
+ if (current_is_kswapd())
+ __count_vm_events(PGDEMOTE_KSWAPD, nr_succeeded);
+ else
+ __count_vm_events(PGDEMOTE_DIRECT, nr_succeeded);
+
return nr_succeeded;
}
diff --git a/mm/vmstat.c b/mm/vmstat.c
index b0534e068166..ec5a2e789dd2 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1217,6 +1217,8 @@ const char * const vmstat_text[] = {
"pgreuse",
"pgsteal_kswapd",
"pgsteal_direct",
+ "pgdemote_kswapd",
+ "pgdemote_direct",
"pgscan_kswapd",
"pgscan_direct",
"pgscan_direct_throttle",
--
2.30.2
Powered by blists - more mailing lists