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: Vinayak Menon <vinmenon@codeaurora.org>
[guptap@codeaurora.org: update resident_page_types dependency, add kconfig]
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
This commit is contained in:
Vinayak Menon 2019-03-10 17:40:16 +05:30 • committed by Prakash Gupta
commit c99ba85df8
3 changed files with 16 additions and 0 deletions

View file

@ -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
};

View file

@ -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;

View file

@ -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