mm/memory.c: skip spurious TLB flush for retried page fault
Recently we found regression when running will_it_scale/page_fault3 test
on ARM64. Over 70% down for the multi processes cases and over 20% down
for the multi threads cases. It turns out the regression is caused by
commit 89b15332af7c ("mm: drop mmap_sem before calling
balance_dirty_pages() in write fault").
The test mmaps a memory size file then write to the mapping, this would
make all memory dirty and trigger dirty pages throttle, that upstream
commit would release mmap_sem then retry the page fault. The retried
page fault would see correct PTEs installed then just fall through to
spurious TLB flush. The regression is caused by the excessive spurious
TLB flush. It is fine on x86 since x86's spurious TLB flush is no-op.
We could just skip the spurious TLB flush to mitigate the regression.
Suggested-by: Linus Torvalds <firstname.lastname@example.org>
Reported-by: Xu Yu <email@example.com>
Debugged-by: Xu Yu <firstname.lastname@example.org>
Tested-by: Xu Yu <email@example.com>
Cc: Johannes Weiner <firstname.lastname@example.org>
Cc: Catalin Marinas <email@example.com>
Cc: Will Deacon <firstname.lastname@example.org>
Signed-off-by: Yang Shi <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
1 file changed