From efa5ce2c9afeae8d4fa6532f45c6a935059b86aa Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Wed, 8 May 2019 18:13:30 +0530 Subject: [PATCH] mm: skip rss check on MM_UNRECLAIMABLE MM_UNRECLAIMABLE rss counter can be updated by drivers on exit_files. But since exit_mm is called early, there is a chance of false bad rss messages. Skip the check for MM_UNRECLAIMABLE. Change-Id: Id9a79db20f1ae711ec801a646d7c28d92e94f70b Signed-off-by: Vinayak Menon [guptap@codeaurora.org: Add Kconfig entry to prevent ABI breakages in GKI] Signed-off-by: Prakash Gupta --- kernel/fork.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index b0371010575c..5139510abbb0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -666,7 +666,15 @@ static void check_mm(struct mm_struct *mm) "Please make sure 'struct resident_page_types[]' is updated as well"); for (i = 0; i < NR_MM_COUNTERS; i++) { - long x = atomic_long_read(&mm->rss_stat.count[i]); + long x; + +#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES + /* MM_UNRECLAIMABLE could be freed later in exit_files */ + if (i == MM_UNRECLAIMABLE) + continue; +#endif + + x = atomic_long_read(&mm->rss_stat.count[i]); if (unlikely(x)) pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n",