From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 E09672C0129 for ; Tue, 7 May 2013 17:25:28 +1000 (EST) Message-ID: <1367911520.5769.12.camel@pasglop> Subject: Re: [PATCH] powerpc: Make hard_irq_disable() do the right thing vs. irq tracing From: Benjamin Herrenschmidt To: "tiejun.chen" Date: Tue, 07 May 2013 17:25:20 +1000 In-Reply-To: <5188AA2D.1040802@windriver.com> References: <1367910242.5769.11.camel@pasglop> <5188AA2D.1040802@windriver.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: Scott Wood , Mihai Caraman , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2013-05-07 at 15:15 +0800, tiejun.chen wrote: > Could we simplify this as follows: > > +#define hard_irq_disable() do { \ > + __hard_irq_disable(); \ > + if (get_paca()->soft_enabled) { \ > + trace_hardirqs_off(); \ > + get_paca()->soft_enabled = 0; \ > + } \ > + get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \ > +} while(0) I'd rather not. When lockdep is not enabled trace_hardirqs_off() is a nop and thus we have no conditional at all which is arguably better... Cheers, Ben.