From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 8C21EB70AD for ; Wed, 19 Aug 2009 13:36:05 +1000 (EST) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F018CDDD0B for ; Wed, 19 Aug 2009 13:36:04 +1000 (EST) Subject: Re: [PATCH] powerpc/mm: Fix assert_pte_locked to work properly on uniprocessor From: Benjamin Herrenschmidt To: Kumar Gala In-Reply-To: <1250644900-32133-1-git-send-email-galak@kernel.crashing.org> References: <1250644900-32133-1-git-send-email-galak@kernel.crashing.org> Content-Type: text/plain Date: Wed, 19 Aug 2009 13:35:57 +1000 Message-Id: <1250652957.4810.6.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2009-08-18 at 20:21 -0500, Kumar Gala wrote: > Since the pte_lockptr is a spinlock it gets optimized away on > uniprocessor builds so using spin_is_locked is not correct. We can use > assert_spin_locked instead and get the proper behavior between UP and > SMP builds. Thanks. Applied. Cheers, Ben. > Signed-off-by: Kumar Gala > --- > arch/powerpc/mm/pgtable.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c > index 627767d..4b9a27d 100644 > --- a/arch/powerpc/mm/pgtable.c > +++ b/arch/powerpc/mm/pgtable.c > @@ -242,7 +242,7 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr) > BUG_ON(pud_none(*pud)); > pmd = pmd_offset(pud, addr); > BUG_ON(!pmd_present(*pmd)); > - BUG_ON(!spin_is_locked(pte_lockptr(mm, pmd))); > + assert_spin_locked(pte_lockptr(mm, pmd)); > } > #endif /* CONFIG_DEBUG_VM */ >