From 6011ee7ef26289bc13117e00d62704549524c078 Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Thu, 17 Sep 2020 19:34:45 +0530 Subject: [PATCH] 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 Signed-off-by: Vinayak Menon --- mm/memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memory.c b/mm/memory.c index 729f02b262ba..90af1dc05cf0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4417,6 +4417,7 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, * If there is no need to retry, don't return the vma to the caller. */ if (ret != VM_FAULT_RETRY) { + check_sync_rss_stat(current); if (vma_is_anonymous(vmf.vma)) count_vm_event(SPECULATIVE_PGFAULT_ANON); else