Skip to content

Commit

Permalink
mm: Add PGREUSE counter
Browse files Browse the repository at this point in the history
This accounts for wp_page_reuse() case, where we reused a page for COW.

Signed-off-by: Peter Xu <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
xzpeter authored and torvalds committed Sep 4, 2020
1 parent a308c71 commit 798a6b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/vm_event_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
PGFAULT, PGMAJFAULT,
PGLAZYFREED,
PGREFILL,
PGREUSE,
PGSTEAL_KSWAPD,
PGSTEAL_DIRECT,
PGSCAN_KSWAPD,
Expand Down
1 change: 1 addition & 0 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
1 change: 1 addition & 0 deletions mm/vmstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ const char * const vmstat_text[] = {
"pglazyfreed",

"pgrefill",
"pgreuse",
"pgsteal_kswapd",
"pgsteal_direct",
"pgscan_kswapd",
Expand Down

0 comments on commit 798a6b8

Please sign in to comment.