From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 17 Nov 2020 11:21:19 +0100 From: Peter Zijlstra Subject: Re: [patch 10/19] preempt: Cleanup the macro maze a bit Message-ID: <20201117102119.GE3121406@hirez.programming.kicks-ass.net> References: <20201113140207.499353218@linutronix.de> <20201113141733.864469886@linutronix.de> <20201116121748.GD3121378@hirez.programming.kicks-ass.net> <871rgtyz9g.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <871rgtyz9g.fsf@nanos.tec.linutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Thomas Gleixner Cc: Marc Zyngier , Rich Felker , Catalin Marinas , Paul McKenney , Arnd Bergmann , linux-sh@vger.kernel.org, Richard Weinberger , Frederic Weisbecker , Valentin Schneider , Jeff Dike , LKML , Yoshinori Sato , "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Helge Deller , Russell King , linux-um@lists.infradead.org, Will Deacon , Sebastian Andrzej Siewior , linux-arm-kernel@lists.infradead.org, Anton Ivanov On Mon, Nov 16, 2020 at 06:42:19PM +0100, Thomas Gleixner wrote: > On Mon, Nov 16 2020 at 13:17, Peter Zijlstra wrote: > > On Fri, Nov 13, 2020 at 03:02:17PM +0100, Thomas Gleixner wrote: > > > >> -#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \ > >> - | NMI_MASK)) > >> +#define irq_count() (nmi_count() | hardirq_count() | softirq_count()) > > > > > >> +#define in_task() (!(in_nmi() | in_hardirq() | in_serving_softirq())) > >> -#define in_task() (!(preempt_count() & \ > >> - (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET))) > > > > How horrible is the code-gen? Because preempt_count() is > > raw_cpu_read_4() and at least some old compilers will refuse to CSE it > > (consider the this_cpu_read_stable mess). > > I looked at gcc8 and 10 output and the compilers are smart enough to > fold it for the !RT case. But yeah ... If recent GCC is smart enough I suppose it doesn't matter, thanks! _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um