mm: Add PGREUSE counter
authorPeter Xu <peterx@redhat.com>
Fri, 21 Aug 2020 23:49:58 +0000 (19:49 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Sep 2020 16:25:20 +0000 (09:25 -0700)
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>
include/linux/vm_event_item.h
mm/memory.c
mm/vmstat.c

index 24fc7c3..58d3f91 100644 (file)
@@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
                PGFAULT, PGMAJFAULT,
                PGLAZYFREED,
                PGREFILL,
+               PGREUSE,
                PGSTEAL_KSWAPD,
                PGSTEAL_DIRECT,
                PGSCAN_KSWAPD,
index 56ae945..20d9300 100644 (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);
 }
 
 /*
index 3fb23a2..907a504 100644 (file)
@@ -1198,6 +1198,7 @@ const char * const vmstat_text[] = {
        "pglazyfreed",
 
        "pgrefill",
+       "pgreuse",
        "pgsteal_kswapd",
        "pgsteal_direct",
        "pgscan_kswapd",