]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory.c: skip spurious TLB flush for retried page fault
authorYang Shi <shy828301@gmail.com>
Sat, 15 Aug 2020 04:30:41 +0000 (21:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Aug 2020 19:02:27 +0000 (12:02 -0700)
commit29b72e1444cc3630994a245dee0130aea5acd045
treec651d03fafea91271226eac6aed875d524d9cf7e
parenta43608b57bfa5047ab842f5b29c2d5f76076819a
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 738a815b55ec ("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 <torvalds@linux-foundation.org>
Reported-by: Xu Yu <xuyu@linux.alibaba.com>
Debugged-by: Xu Yu <xuyu@linux.alibaba.com>
Tested-by: Xu Yu <xuyu@linux.alibaba.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Yang Shi <shy828301@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c