From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/3] powerpc/mm: Rename find_linux_pte_or_hugepte
Date: Wed, 17 May 2017 11:00:40 +0530 [thread overview]
Message-ID: <d87fa489-38f3-5b13-7267-92e7c4fee09e@linux.vnet.ibm.com> (raw)
In-Reply-To: <1494997069.3092.5.camel@kernel.crashing.org>
On Wednesday 17 May 2017 10:27 AM, Benjamin Herrenschmidt wrote:
> On Wed, 2017-05-17 at 08:57 +0530, Aneesh Kumar K.V wrote:
>> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
>>
>>> On Tue, 2017-05-16 at 14:56 +0530, Aneesh Kumar K.V wrote:
>>>> +static inline pte_t *find_linux_pte(pgd_t *pgdir, unsigned long ea,
>>>> + bool *is_thp, unsigned *hshift)
>>>> +{
>>>> + VM_WARN((!arch_irqs_disabled() && !__hard_irqs_disabled()) ,
>>>> + "%s called with irq enabled\n", __func__);
>>>> + return __find_linux_pte(pgdir, ea, is_thp, hshift);
>>>> +}
>>>> +
>>> When is arch_irqs_disabled() not sufficient ?
>> We can do lockless page table walk in interrupt handlers where we find
>> MSR_EE = 0.
> Such as ?
>
>> I was not sure we mark softenabled 0 there. What I wanted to
>> indicate in the patch is that we are safe with either softenable = 0 or MSR_EE = 0
> Reading the MSR is expensive...
>
> Can you find a case where we are hard disabled and not soft disable in
> C code ? I can't think of one off-hand ... I know we have some asm that
> can do that very temporarily but I wouldn't think we have anything at
> runtime.
>
> Talking of which, we have this in irq.c:
>
>
> #ifdef CONFIG_TRACE_IRQFLAGS
> else {
> /*
> * We should already be hard disabled here. We had bugs
> * where that wasn't the case so let's dbl check it and
> * warn if we are wrong. Only do that when IRQ tracing
> * is enabled as mfmsr() can be costly.
> */
> if (WARN_ON(mfmsr() & MSR_EE))
> __hard_irq_disable();
> }
> #endif
>
> I think we should move that to a new CONFIG_PPC_DEBUG_LAZY_IRQ because
> distros are likely to have CONFIG_TRACE_IRQFLAGS these days no ?
Yes, CONFIG_TRACE_IRQFLAGS are enabled. So in my local_t patchset,
I have added a patch to do the same with a flag "CONFIG_IRQ_DEBUG_SUPPORT"
mpe reported boot hang with the current version of the
local_t patchset in Booke system, and have a fix for the
same and it is being tested. Will post a newer version
once the patch verified.
Maddy
>
> Also we could add additional checks, such as MSR_EE matching paca-
>> irq_happened or the above you mentioned, ie, WARN if we find case
> where IRQs are hard disabled but soft enabled.
>
> If we find these, I think we should fix them.
>
> Cheers,
> Ben.
>
next prev parent reply other threads:[~2017-05-17 5:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 9:26 [PATCH 1/3] powerpc: Add __hard_irqs_disabled() Aneesh Kumar K.V
2017-05-16 9:26 ` [PATCH 2/3] powerpc/mm: Rename find_linux_pte_or_hugepte Aneesh Kumar K.V
2017-05-16 11:22 ` Benjamin Herrenschmidt
2017-05-17 3:27 ` Aneesh Kumar K.V
2017-05-17 4:57 ` Benjamin Herrenschmidt
2017-05-17 5:30 ` Madhavan Srinivasan [this message]
2017-05-29 14:32 ` Aneesh Kumar K.V
2017-05-30 3:21 ` Benjamin Herrenschmidt
2017-05-16 9:26 ` [PATCH 3/3] powerpc/mm: Don't send IPI to all cpus on THP updates Aneesh Kumar K.V
2017-05-16 11:22 ` [PATCH 1/3] powerpc: Add __hard_irqs_disabled() Benjamin Herrenschmidt
2017-05-17 11:04 ` Balbir Singh
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=d87fa489-38f3-5b13-7267-92e7c4fee09e@linux.vnet.ibm.com \
--to=maddy@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).