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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 4C421C84507 for ; Mon, 16 Nov 2020 12:38:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFAEF20855 for ; Mon, 16 Nov 2020 12:38:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="eSQGkQEa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729984AbgKPMSR (ORCPT ); Mon, 16 Nov 2020 07:18:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbgKPMSP (ORCPT ); Mon, 16 Nov 2020 07:18:15 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B96C0613CF; Mon, 16 Nov 2020 04:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bQMq5TZF86IM/5Y94jT9C5QIrKLF+iu+uQmY1bh2ZzQ=; b=eSQGkQEayKHgS/hoe3uDgFONQ3 Yx3Ye2/ArnTKwvDcz2D218ytbiMgxdS0bbWfiBz8QeeRvkZQ0O4rztVu5HZf9xGCumpsHiwSFSD+H paVr3v8GPt4dfe6X+b31/j3tAFcg4wCSf68QkPbhqsiU7bkECtPA6pZjYd6FmPEQAluQOcTeWqCF3 IAnSgq2PdxWz1exvOeZ/5ONexQjsFidRpjCZ5audNW0X4a20/jahfZugICLYZSMJUyUOIy9V9M7lq NIaJzH2pTgxAXElk7Jx8JdPKBqXA7T6sLwZBMobBCleos4MCeD5Bwb+QzPe632b7nSMkNUcmPtavH LQQ3Q2oA==; 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 Cc: LKML , Frederic Weisbecker , Paul McKenney , Sebastian Andrzej Siewior , Arnd Bergmann , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Russell King , Marc Zyngier , Valentin Schneider , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201113141733.864469886@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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).