Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75258ab7 authored by Vinayak Menon's avatar Vinayak Menon Committed by Isaac J. Manjarres
Browse files

mm: vmstat: add pageoutclean



vmstat events currently count pgpgout, but that includes
only the writebacks, and not the reclaim of clean
pages. Add an event to count clean page evictions. This is
helpful to evaluate page thrashing cases.

Change-Id: Icfb797877a544a58c289074bdc290dfbc1384514
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
[isaacm@codeaurora.org: Add Kconfig entry to prevent ABI breakages in GKI]
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 13879ddd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,11 @@

#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL, HIGHMEM_ZONE(xx) xx##_MOVABLE

enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
enum vm_event_item { PGPGIN, PGPGOUT,
#ifdef CONFIG_VM_EVENT_COUNT_CLEAN_PAGE_RECLAIM
		PGPGOUTCLEAN,
#endif
		PSWPIN, PSWPOUT,
		FOR_ALL_ZONES(PGALLOC),
		FOR_ALL_ZONES(ALLOCSTALL),
		FOR_ALL_ZONES(PGSCAN_SKIP),
+12 −0
Original line number Diff line number Diff line
@@ -1779,6 +1779,18 @@ config VM_EVENT_COUNTERS
	  on EXPERT systems.  /proc/vmstat will only show page counts
	  if VM event counters are disabled.

config VM_EVENT_COUNT_CLEAN_PAGE_RECLAIM
	bool "Track the number of clean pages reclaimed from the page cache"
	depends on VM_EVENT_COUNTERS
	help
	  VM event counters currently maintain a count of the pages that
	  get dropped from the page cache as a part of memory reclaim.
	  However, this count only tracks the number of dirty pages that
	  get dropped, and does not account for the clean pages that get
	  dropped as well. Enable this to also account for the clean pages
	  that get dropped as part of memory reclaim to get a more holistic
	  view of what is happening during memory reclaim.

config SLUB_DEBUG
	default y
	bool "Enable SLUB debugging support" if EXPERT
+15 −2
Original line number Diff line number Diff line
@@ -153,6 +153,17 @@ static void page_cache_delete(struct address_space *mapping,
	mapping->nrpages -= nr;
}

#ifdef CONFIG_VM_EVENT_COUNT_CLEAN_PAGE_RECLAIM
static void count_vm_event_clean_page_put(void)
{
	count_vm_event(PGPGOUTCLEAN);
}
#else
static void count_vm_event_clean_page_put(void)
{
}
#endif

static void unaccount_page_cache_page(struct address_space *mapping,
				      struct page *page)
{
@@ -163,10 +174,12 @@ static void unaccount_page_cache_page(struct address_space *mapping,
	 * invalidate any existing cleancache entries.  We can't leave
	 * stale data around in the cleancache once our page is gone
	 */
	if (PageUptodate(page) && PageMappedToDisk(page))
	if (PageUptodate(page) && PageMappedToDisk(page)) {
		count_vm_event_clean_page_put();
		cleancache_put_page(page);
	else
	} else {
		cleancache_invalidate_page(mapping, page);
	}

	VM_BUG_ON_PAGE(PageTail(page), page);
	VM_BUG_ON_PAGE(page_mapped(page), page);
+3 −0
Original line number Diff line number Diff line
@@ -1176,6 +1176,9 @@ const char * const vmstat_text[] = {
	/* enum vm_event_item counters */
	"pgpgin",
	"pgpgout",
#ifdef CONFIG_VM_EVENT_COUNT_CLEAN_PAGE_RECLAIM
	"pgpgoutclean",
#endif
	"pswpin",
	"pswpout",