From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754446AbcFGIg1 (ORCPT ); Tue, 7 Jun 2016 04:36:27 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34810 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754428AbcFGIgY (ORCPT ); Tue, 7 Jun 2016 04:36:24 -0400 Subject: Re: [PATCH 2/2] powerpc/mm: check for irq disabled() only if DEBUG_VM is enabled. To: "Aneesh Kumar K.V" , akpm@linux-foundation.org, mpe@ellerman.id.au References: <1464692688-6612-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1464692688-6612-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Balbir Singh Message-ID: <3eb96c44-98fa-cc51-276c-727d0241c849@gmail.com> Date: Tue, 7 Jun 2016 18:36:17 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1464692688-6612-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.