powerpc/64s/hash: add stress_hpt kernel boot option to increase hash faults
authorNicholas Piggin <npiggin@gmail.com>
Mon, 24 Oct 2022 03:01:50 +0000 (13:01 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 07:04:25 +0000 (18:04 +1100)
commit6b34a099faa123488b13caf704562f4dbe483fc4
tree288c5677f61f2573aa3b768502ce5577b353d4cb
parentdfecd06bc5524517ed7737c30eaaf747338b280a
powerpc/64s/hash: add stress_hpt kernel boot option to increase hash faults

This option increases the number of hash misses by limiting the number
of kernel HPT entries, by keeping a per-CPU record of the last kernel
HPTEs installed, and removing that from the hash table on the next hash
insertion. A timer round-robins CPUs removing remaining kernel HPTEs and
clearing the TLB (in the case of bare metal) to increase and slightly
randomise kernel fault activity.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Add comment about NR_CPUS usage, fixup whitespace]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221024030150.852517-1-npiggin@gmail.com
Documentation/admin-guide/kernel-parameters.txt
arch/powerpc/mm/book3s64/hash_4k.c
arch/powerpc/mm/book3s64/hash_64k.c
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/book3s64/internal.h