From cf397c6c269ac9f5dcb1faf439f7a16dee6a83e4 Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Thu, 17 Sep 2020 19:34:45 +0530 Subject: [PATCH] ANDROID: mm: sync rss in speculative page fault path The speculative page fault path does not sync the rss in task_struct to mm_struct leading to large variance in the RSS values observed by userspace tools and also in the OOM task dump. Change-Id: Id45f1b9b0a51a9afffbaf8e65f5ef747d409d0d7 Bug: 179217427 Signed-off-by: Vinayak Menon --- mm/memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index 3538056e4501..1d46609c4597 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4856,6 +4856,8 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, flags &= ~(FAULT_FLAG_ALLOW_RETRY|FAULT_FLAG_KILLABLE); flags |= FAULT_FLAG_SPECULATIVE; + check_sync_rss_stat(current); + *vma = get_vma(mm, address); if (!*vma) return VM_FAULT_RETRY;