linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	akpm@linux-foundation.org, mpe@ellerman.id.au
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.
Date: Tue, 7 Jun 2016 18:36:17 +1000	[thread overview]
Message-ID: <3eb96c44-98fa-cc51-276c-727d0241c849@gmail.com> (raw)
In-Reply-To: <1464692688-6612-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>



On 31/05/16 21:04, Aneesh Kumar K.V wrote:
> We don't need to check this always. The idea here is to capture the
> wrong usage of find_linux_pte_or_hugepte and we can do that by
> occasionally running with DEBUG_VM enabled.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/pgtable.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
> index ee09e99097f0..9bd87f269d6d 100644
> --- a/arch/powerpc/include/asm/pgtable.h
> +++ b/arch/powerpc/include/asm/pgtable.h
> @@ -71,10 +71,8 @@ pte_t *__find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
>  static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
>  					       bool *is_thp, unsigned *shift)
>  {
> -	if (!arch_irqs_disabled()) {
> -		pr_info("%s called with irq enabled\n", __func__);
> -		dump_stack();
> -	}
> +	VM_WARN(!arch_irqs_disabled(),
> +		"%s called with irq enabled\n", __func__);
>  	return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift);
>  }

Agreed! Honestly, I think it should be a VM_BUG_ON() since we have a large reliance
on this elsewhere in the code.

Balbir Singh.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2016-06-07  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 11:04 [PATCH 1/2] mm/debug: Add VM_WARN which maps to WARN() Aneesh Kumar K.V
2016-05-31 11:04 ` [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled Aneesh Kumar K.V
2016-06-07  6:54   ` Anshuman Khandual
2016-06-07  8:36   ` Balbir Singh [this message]
2016-06-07  6:52 ` [PATCH 1/2] mm/debug: Add VM_WARN which maps to WARN() Anshuman Khandual

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=3eb96c44-98fa-cc51-276c-727d0241c849@gmail.com \
    --to=bsingharora@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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