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

Commit c99ba85d authored by Vinayak Menon's avatar Vinayak Menon Committed by Prakash Gupta
Browse files

mm: add rss counter for unreclaimable pages



Add a per mm rss counter to hold the unreclaimable
pages. This can include the pages allocated by a
task and shared with hardware for DMA etc.

Change-Id: Iec77d69eca0a4f8f6e23f866c80c0143620fcaf2
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
[guptap@codeaurora.org: update resident_page_types dependency, add kconfig]
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
parent 64e68fd5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ enum {
	MM_ANONPAGES,	/* Resident anonymous pages */
	MM_SWAPENTS,	/* Anonymous swap entries */
	MM_SHMEMPAGES,	/* Resident shared memory pages */
#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
	MM_UNRECLAIMABLE,	/* Unreclaimable pages, e.g. shared with HW */
#endif
	NR_MM_COUNTERS
};

+3 −0
Original line number Diff line number Diff line
@@ -134,6 +134,9 @@ static const char * const resident_page_types[] = {
	NAMED_ARRAY_INDEX(MM_ANONPAGES),
	NAMED_ARRAY_INDEX(MM_SWAPENTS),
	NAMED_ARRAY_INDEX(MM_SHMEMPAGES),
#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
	NAMED_ARRAY_INDEX(MM_UNRECLAIMABLE),
#endif
};

DEFINE_PER_CPU(unsigned long, process_counts) = 0;
+10 −0
Original line number Diff line number Diff line
@@ -758,6 +758,16 @@ config PERCPU_STATS
	  information includes global and per chunk statistics, which can
	  be used to help understand percpu memory usage.

config MM_STAT_UNRECLAIMABLE_PAGES
	default y
	depends on QGKI
	bool "Enable counter for unreclaimable pages"
	help
	  Unreclaimable pages counters accounts the pages that cannot be
	  reclaimed under memory pressure. These include mm rss and global
	  counter. This option allows the enabling of the mm rss and global
	  unreclaimables pages counters on QGKI systems.

config HAVE_USERSPACE_LOW_MEMORY_KILLER
	bool "Configure reclaim paths if there is a userspace LMK"
	default n