From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@ozlabs.org, Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH v4 2/2] powerpc/64s/hash: Add stress_hpt kernel boot option to increase hash faults
Date: Wed, 13 May 2020 14:50:24 +1000 [thread overview]
Message-ID: <1589344619.irwrodmhoy.astroid@bobo.none> (raw)
In-Reply-To: <20200511125825.3081305-2-mpe@ellerman.id.au>
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
next prev parent reply other threads:[~2020-05-13 4:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 12:58 [PATCH v4 1/2] powerpc/64s/hash: Add stress_slb kernel boot option to increase SLB faults Michael Ellerman
2020-05-11 12:58 ` [PATCH v4 2/2] powerpc/64s/hash: Add stress_hpt kernel boot option to increase hash faults Michael Ellerman
2020-05-13 4:50 ` Nicholas Piggin [this message]
2020-06-09 5:29 ` [PATCH v4 1/2] powerpc/64s/hash: Add stress_slb kernel boot option to increase SLB faults Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1589344619.irwrodmhoy.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox