diff --git a/include/linux/mm_types_task.h b/include/linux/mm_types_task.h index c1bc6731125c..2db5b5028ca5 100644 --- a/include/linux/mm_types_task.h +++ b/include/linux/mm_types_task.h @@ -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 }; diff --git a/kernel/fork.c b/kernel/fork.c index f89e8c85f2b8..b0371010575c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -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; diff --git a/mm/Kconfig b/mm/Kconfig index 35ecdc808844..a4de732f22dc 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -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