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 0685CC63777 for ; Tue, 17 Nov 2020 10:22:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94DCD208CA for ; Tue, 17 Nov 2020 10:22:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WkL2DpM4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727214AbgKQKVy (ORCPT ); Tue, 17 Nov 2020 05:21:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbgKQKVx (ORCPT ); Tue, 17 Nov 2020 05:21:53 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F96C0613CF; Tue, 17 Nov 2020 02:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=lz8fb1sA27SpTdUEKJWeEE6yTKqyBHsG4/7A8XEhKU0=; b=WkL2DpM49F2w4P+YSmMqpgYZ0h noytDa9oWxuztYs4L02dt10qN3d6HvrlKa0oLByIaG8m8+zoqtsIKUdIy81aGN0AfB2EgVhImk6NF 4F3+mCsU78CgfgrigRrYWAWF2d1rcQNg6uU2no2kV0o/eni+jT/Nyp48FY+kAcBwjCstyR9cxarWE Ei+E3jW+ypULpMbm6GZkIurr/YfrjGjSsVFLU/d6TLbK9DCfMXnCYL7bkSfMpKwQRWzpY32GZGqdH cL2NX6iLhhhRCeTior/wT0GkRt1U3LSc6pBp1hadGwBS/UP0g5G6hsrRwp5TZETyBxEvGr+rlgAzk o0QZ7mmg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1key6y-0000EQ-Q4; Tue, 17 Nov 2020 10:21:21 +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 84FDE3019CE; Tue, 17 Nov 2020 11:21:19 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 28E4029AC4786; Tue, 17 Nov 2020 11:21:19 +0100 (CET) Date: Tue, 17 Nov 2020 11:21:19 +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: <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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871rgtyz9g.fsf@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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! 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 8E01DC2D0E4 for ; Tue, 17 Nov 2020 10:21:56 +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 F0446208C7 for ; Tue, 17 Nov 2020 10:21:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XHtXjbXF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WkL2DpM4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0446208C7 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=sMo7PUOsv7wvP70t440K3i3Sd1nK9FoTxPTVwfeE9YU=; b=XHtXjbXFQrFmkfd0THpM1Txqa I2tdFYWK+CJkhktFGO864nvQE1brW0ylo/jitwcR1D+wslQAKvEV/ZWp/UCCE1uMkPmUfGFijWsoe XY97psqQ6wTqdcgixkCe+Sbk6gwCRLqxs4QAFFiVHcj5U4oJrI0mlDj1q1axIhWXUpIF0Yw/BrRiu jdnM7D5LnlLsSv057WrD7/w3wG6usfjSni8Kxb3jqsaSOUJn1TfTfsLX5Ropt4ZFXXhu3jiUzkX5A Jgzkc2owd88yeLGBknHAn7KNdHY++tnvKrjrNRvyDpvIOHFHpCpz3QR0gzjqzr7s/yhjpRrW63Tpx dFvgJKSvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1key75-0006GX-T6; Tue, 17 Nov 2020 10:21:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1key73-0006GJ-LH; Tue, 17 Nov 2020 10:21:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=lz8fb1sA27SpTdUEKJWeEE6yTKqyBHsG4/7A8XEhKU0=; b=WkL2DpM49F2w4P+YSmMqpgYZ0h noytDa9oWxuztYs4L02dt10qN3d6HvrlKa0oLByIaG8m8+zoqtsIKUdIy81aGN0AfB2EgVhImk6NF 4F3+mCsU78CgfgrigRrYWAWF2d1rcQNg6uU2no2kV0o/eni+jT/Nyp48FY+kAcBwjCstyR9cxarWE Ei+E3jW+ypULpMbm6GZkIurr/YfrjGjSsVFLU/d6TLbK9DCfMXnCYL7bkSfMpKwQRWzpY32GZGqdH cL2NX6iLhhhRCeTior/wT0GkRt1U3LSc6pBp1hadGwBS/UP0g5G6hsrRwp5TZETyBxEvGr+rlgAzk o0QZ7mmg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1key6y-0000EQ-Q4; Tue, 17 Nov 2020 10:21:21 +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 84FDE3019CE; Tue, 17 Nov 2020 11:21:19 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 28E4029AC4786; Tue, 17 Nov 2020 11:21:19 +0100 (CET) Date: Tue, 17 Nov 2020 11:21:19 +0100 From: Peter Zijlstra To: Thomas Gleixner 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> 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 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-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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