]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/code-patching: Speed up page mapping/unmapping
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 15 Aug 2022 11:48:40 +0000 (21:48 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 1 Sep 2022 03:56:01 +0000 (13:56 +1000)
commitd4aaab41d5527ab2d87b7e338cc7a1be9470116e
treebf75102ea37125fa90e447d060e90fc26a6db58f
parent4e490e464e3f732b1a6fb088608af07dd6ab3e6d
powerpc/code-patching: Speed up page mapping/unmapping

Since commit 88d0862127b9 ("powerpc/code-patching: Pre-map patch area")
the patch area is premapped so intermediate page tables are already
allocated.

Use __set_pte_at() directly instead of the heavy map_kernel_page(),
at for unmapping just do a pte_clear() followed by a flush.

__set_pte_at() can be used directly without the filters in
set_pte_at() because we are mapping a normal page non executable.

Make sure gcc knows text_poke_area is page aligned in order to
optimise the flush.

This change reduces by 66% the time needed to activate ftrace on
an 8xx (588000 tb ticks instead of 1744000).

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Add ptesync needed on radix to avoid spurious fault]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220815114840.1468656-1-mpe@ellerman.id.au
arch/powerpc/lib/code-patching.c