From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15B75C6369E for ; Mon, 16 Nov 2020 12:19:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0E6B2224B for ; Mon, 16 Nov 2020 12:19:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tZrZGtPh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0E6B2224B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0gkG8c6bCoyDzx1DY+QPcSqJycs4NFFtP10Ubw4eEWQ=; b=tZrZGtPhKEIlQwW/JFpXTvMwq B7kRJX+7O8Y2YFtJl0tDmQ22m7Abstgc+WPY3mW4C4CNl0OIVm99RRLql/o5nemrGFwxVbi4eM9km fVwJ9/5Z+S80eq0VQd0iCYHTn00aurp3PDqmtEtocYF8Nf9J/LpuO/daKmHwDnvGLwylt2EOg/2cA FZCHyKfQ5jCm/36PZIfKz79Msm8SZJRrVEgZMMF/Sjx0CUJ3VGh8GshhRmRl8mlUAL8JCcKwLf5FJ IcuwcKqKFYtL7eXalRwiYZ9gC+sdjLHbLHcdKHj7IzEsCMj7Dnp8X0FafPaI2z8BPWIDivVYgg6Nz zfypEeaAA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedSG-0005VP-6v; Mon, 16 Nov 2020 12:17:56 +0000 Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedSB-0005Ul-Eg; Mon, 16 Nov 2020 12:17:51 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E9FFA307062; Mon, 16 Nov 2020 13:17:48 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AE60220299B60; Mon, 16 Nov 2020 13:17:48 +0100 (CET) Date: Mon, 16 Nov 2020 13:17:48 +0100 From: Peter Zijlstra To: Thomas Gleixner Subject: Re: [patch 10/19] preempt: Cleanup the macro maze a bit Message-ID: <20201116121748.GD3121378@hirez.programming.kicks-ass.net> References: <20201113140207.499353218@linutronix.de> <20201113141733.864469886@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201113141733.864469886@linutronix.de> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel