mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault
upatepp can get called for a nohpte fault when we find from the linux
page table that the translation was hashed before. In that case
we are sure that there is no existing translation, hence we could
avoid doing tlbie.
We could possibly race with a parallel fault filling the TLB. But
that should be ok because updatepp is only ever relaxing permissions.
We also look at linux pte permission bits when filling hash pte
permission bits. We also hold the linux pte busy bits while
inserting/updating a hashpte entry, hence a paralle update of
linux pte is not possible. On the other hand mprotect involves
ptep_modify_prot_start which cause a hpte invalidate and not updatepp.
Performance number:
We use randbox_access_bench written by Anton.
Kernel with THP disabled and smaller hash page table size.
86.60% random_access_b [kernel.kallsyms] [k] .native_hpte_updatepp
2.10% random_access_b random_access_bench [.] doit
1.99% random_access_b [kernel.kallsyms] [k] .do_raw_spin_lock
1.85% random_access_b [kernel.kallsyms] [k] .native_hpte_insert
1.26% random_access_b [kernel.kallsyms] [k] .native_flush_hash_range
1.18% random_access_b [kernel.kallsyms] [k] .__delay
0.69% random_access_b [kernel.kallsyms] [k] .native_hpte_remove
0.37% random_access_b [kernel.kallsyms] [k] .clear_user_page
0.34% random_access_b [kernel.kallsyms] [k] .__hash_page_64K
0.32% random_access_b [kernel.kallsyms] [k] fast_exception_return
0.30% random_access_b [kernel.kallsyms] [k] .hash_page_mm
With Fix:
27.54% random_access_b random_access_bench [.] doit
22.90% random_access_b [kernel.kallsyms] [k] .native_hpte_insert
5.76% random_access_b [kernel.kallsyms] [k] .native_hpte_remove
5.20% random_access_b [kernel.kallsyms] [k] fast_exception_return
5.12% random_access_b [kernel.kallsyms] [k] .__hash_page_64K
4.80% random_access_b [kernel.kallsyms] [k] .hash_page_mm
3.31% random_access_b [kernel.kallsyms] [k] data_access_common
1.84% random_access_b [kernel.kallsyms] [k] .trace_hardirqs_on_caller
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
This commit is contained in:
parent
abb90ee7bc
commit
aefa5688c0
16 changed files with 91 additions and 57 deletions
|
|
@ -133,7 +133,7 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
|
|||
{
|
||||
unsigned flt = 0;
|
||||
int result;
|
||||
unsigned long access, flags;
|
||||
unsigned long access, flags, inv_flags = 0;
|
||||
|
||||
if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) {
|
||||
pr_devel("copro_handle_mm_fault failed: %#x\n", result);
|
||||
|
|
@ -149,8 +149,12 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
|
|||
access |= _PAGE_RW;
|
||||
if ((!ctx->kernel) || ~(dar & (1ULL << 63)))
|
||||
access |= _PAGE_USER;
|
||||
|
||||
if (dsisr & DSISR_NOHPTE)
|
||||
inv_flags |= HPTE_NOHPTE_UPDATE;
|
||||
|
||||
local_irq_save(flags);
|
||||
hash_page_mm(mm, dar, access, 0x300);
|
||||
hash_page_mm(mm, dar, access, 0x300, inv_flags);
|
||||
local_irq_restore(flags);
|
||||
|
||||
pr_devel("Page fault successfully handled for pe: %i!\n", ctx->pe);
|
||||
|
|
|
|||
Loading…
Reference in a new issue