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>
This commit is contained in:
Peter Xu 2020-08-21 19:49:58 -04:00 committed by Linus Torvalds
parent a308c71bf1
commit 798a6b87ec
3 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
PGFAULT, PGMAJFAULT,
PGLAZYFREED,
PGREFILL,
PGREUSE,
PGSTEAL_KSWAPD,
PGSTEAL_DIRECT,
PGSCAN_KSWAPD,

View File

@ -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);
}
/*

View File

@ -1198,6 +1198,7 @@ const char * const vmstat_text[] = {
"pglazyfreed",
"pgrefill",
"pgreuse",
"pgsteal_kswapd",
"pgsteal_direct",
"pgscan_kswapd",