aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2020-08-21 19:49:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2020-09-04 09:25:20 -0700
commit798a6b87ecd72828a6c6b5469aaa2032a57e92b7 (patch)
tree12c67139a23f97deb577f098b320c787c99a25b9
parentmm/gup: Remove enfornced COW mechanism (diff)
downloadwireguard-linux-798a6b87ecd72828a6c6b5469aaa2032a57e92b7.tar.xz
wireguard-linux-798a6b87ecd72828a6c6b5469aaa2032a57e92b7.zip
mm: Add PGREUSE counter
This accounts for wp_page_reuse() case, where we reused a page for COW. Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/vm_event_item.h1
-rw-r--r--mm/memory.c1
-rw-r--r--mm/vmstat.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 24fc7c3ae7d6..58d3f91baad1 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
PGFAULT, PGMAJFAULT,
PGLAZYFREED,
PGREFILL,
+ PGREUSE,
PGSTEAL_KSWAPD,
PGSTEAL_DIRECT,
PGSCAN_KSWAPD,
diff --git a/mm/memory.c b/mm/memory.c
index 56ae945c6845..20d93001ef93 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2619,6 +2619,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf)
if (ptep_set_access_flags(vma, vmf->address, vmf->pte, entry, 1))
update_mmu_cache(vma, vmf->address, vmf->pte);
pte_unmap_unlock(vmf->pte, vmf->ptl);
+ count_vm_event(PGREUSE);
}
/*
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 3fb23a21f6dd..907a5045bfa3 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1198,6 +1198,7 @@ const char * const vmstat_text[] = {
"pglazyfreed",
"pgrefill",
+ "pgreuse",
"pgsteal_kswapd",
"pgsteal_direct",
"pgscan_kswapd",