Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1410156 > unrolled thread

[PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.

Started by"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
First post2016-05-31 13:10 +0200
Last post2016-06-07 10:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled. "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-05-31 13:10 +0200
    Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM  is enabled. Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-06-07 09:00 +0200
    Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM  is enabled. Balbir Singh <bsingharora@gmail.com> - 2016-06-07 10:40 +0200

#1410156 — [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.

From"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Date2016-05-31 13:10 +0200
Subject[PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.
Message-ID<rEPIC-1X8-17@gated-at.bofh.it>
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);
 }
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1415760 — Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.

FromAnshuman Khandual <khandual@linux.vnet.ibm.com>
Date2016-06-07 09:00 +0200
SubjectRe: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.
Message-ID<rHj9v-7GF-3@gated-at.bofh.it>
In reply to#1410156
On 05/31/2016 04:34 PM, 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>

Reviewed-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>

[toc] | [prev] | [next] | [standalone]


#1415864 — Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.

FromBalbir Singh <bsingharora@gmail.com>
Date2016-06-07 10:40 +0200
SubjectRe: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled.
Message-ID<rHkIh-nf-19@gated-at.bofh.it>
In reply to#1410156

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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web