[PATCH v4 2/2] powerpc/64s/hash: Add stress_hpt kernel boot option to increase hash faults
Nicholas Piggin
npiggin at gmail.com
Wed May 13 14:50:24 AEST 2020
Excerpts from Michael Ellerman's message of May 11, 2020 10:58 pm:
> +void hpt_do_stress(unsigned long ea, unsigned long access,
> + unsigned long rflags, unsigned long hpte_group)
> +{
> + unsigned long last_group;
> + int cpu = raw_smp_processor_id();
> +
> + last_group = stress_hpt_last_group[cpu];
> + if (last_group != -1UL) {
> + while (mmu_hash_ops.hpte_remove(last_group) != -1)
> + ;
This seems to have issues causing hangs and livelocking, particularly on
SMP guests. I think another CPU taking a fault and inserting an HPTE
into this group can get stuck when it has its entry removed before it can
return from the fault and load its TLB, so it faults again.
The hpte_remove hypercall must be slow enough on a guest that this loop
doesn't finish before the other CPU comes in and puts another entry in
there. Which explains why I didn't see it on bare metal.
Removing the loop doesn't end up generating a lot of faults because most
HPTEs are userspace, so they end up overwhelming the kernel HPTE
removal.
Using hpte_invalidate to invalidate the specific entry might be the go,
although it removes some element of randomness at least on PowerNV --
the kernel TLB is still there and will fault "some time" when the TLB
entry drops out.
Maybe hpt stress should go into the hash implementation. I'm thinking
about what to do.
Better drop this patch for now, but the SLB one should be good to go.
Thanks,
Nick
More information about the Linuxppc-dev
mailing list