]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: add pte_needs_flush and huge_pmd_needs_flush
authorNicholas Piggin <npiggin@gmail.com>
Thu, 1 Sep 2022 11:03:34 +0000 (21:03 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 8 Sep 2022 01:11:18 +0000 (11:11 +1000)
commit1bb0ec787557ea47494a2d581fb1e6a3655c45f9
tree0aac8dccb9c47241a147f2fc9e6183b90366d676
parent33e5c7da5107e30b27ee902bbf76838c5298bad3
powerpc/64s: add pte_needs_flush and huge_pmd_needs_flush

Allow PTE changes to avoid flushing the TLB when access permissions are
being relaxed, the dirty bit is being set, and the accessed bit is being
changed.

Relaxing access permissions and setting dirty and accessed bits do not
require a flush because the MMU will re-load the PTE and notice the
updates (it may also cause a spurious fault).

Clearing the accessed bit does not require a flush because of the
imprecise PTE accessed bit accounting that is already performed, as
documented in ptep_clear_flush_young().

This reduces TLB flushing for some mprotect(2) calls.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20220901110334.1618913-1-npiggin@gmail.com
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/book3s/64/tlbflush.h