aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/swap_state.c9
-rw-r--r--mm/vmstat.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c
index b68c93014f50..d1bdb31cab13 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -305,8 +305,10 @@ struct page * lookup_swap_cache(swp_entry_t entry)
if (page && likely(!PageTransCompound(page))) {
INC_CACHE_INFO(find_success);
- if (TestClearPageReadahead(page))
+ if (TestClearPageReadahead(page)) {
atomic_inc(&swapin_readahead_hits);
+ count_vm_event(SWAP_RA_HIT);
+ }
}
INC_CACHE_INFO(find_total);
@@ -516,8 +518,11 @@ struct page *swapin_readahead(swp_entry_t entry, gfp_t gfp_mask,
gfp_mask, vma, addr, false);
if (!page)
continue;
- if (offset != entry_offset && likely(!PageTransCompound(page)))
+ if (offset != entry_offset &&
+ likely(!PageTransCompound(page))) {
SetPageReadahead(page);
+ count_vm_event(SWAP_RA);
+ }
put_page(page);
}
blk_finish_plug(&plug);
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 85f3a2e04adc..c7e4b8458023 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1098,6 +1098,10 @@ const char * const vmstat_text[] = {
"vmacache_find_hits",
"vmacache_full_flushes",
#endif
+#ifdef CONFIG_SWAP
+ "swap_ra",
+ "swap_ra_hit",
+#endif
#endif /* CONFIG_VM_EVENTS_COUNTERS */
};
#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */