powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled

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.

Link: http://lkml.kernel.org/r/1464692688-6612-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Aneesh Kumar K.V 2016-07-26 15:22:39 -07:00 committed by Linus Torvalds
parent a54f9aebaa
commit 9af3f56ba1

View File

@ -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, static inline pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
bool *is_thp, unsigned *shift) bool *is_thp, unsigned *shift)
{ {
if (!arch_irqs_disabled()) { VM_WARN(!arch_irqs_disabled(),
pr_info("%s called with irq enabled\n", __func__); "%s called with irq enabled\n", __func__);
dump_stack();
}
return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift); return __find_linux_pte_or_hugepte(pgdir, ea, is_thp, shift);
} }