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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C9A1CCA481 for ; Wed, 8 Jun 2022 17:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i/mWL6pm3a2QwJnlEdHu9wMyK3dosheuvyvgJTIvDjo=; b=wMrLYhBsB3J+ec PqrhtyMZ+76M1GcSEVcT5Z9j9dD5cQ+WKbfyjAFLnA5RDsT5Qyd8Axt0675smqk9Zo99CGxCUntsE Ap3o0RO7moQOrTwZPsWC8LhX+ICUex9nTU5561wFq+ETkNVd4LD1c0BfsEsr1HCegUukUMTAVIoUy 12D1+c7q3ZG6elCwhDfeEYWJQ72DxSN/nO6ijITcHnyIeMuqHxXeSBdPF2hgWZJQiv5aRiwhRTbau s8Orsw3/MMxFIgA/6+cbbYMH1+JULFBGeO/Rbz1JmkHcmzcOh9XSqI8NG5k+vbISyPudlpRstoKOu S4rDYUyII+S2ETfxt6YQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyzQ9-00EUS0-0G; Wed, 08 Jun 2022 17:24:41 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyzQ5-00EUPH-6T; Wed, 08 Jun 2022 17:24:38 +0000 Received: from mail-ot1-f52.google.com ([209.85.210.52]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M6VNX-1o5pyg0jMH-006xVW; Wed, 08 Jun 2022 19:24:31 +0200 Received: by mail-ot1-f52.google.com with SMTP id w19-20020a9d6393000000b0060aeb359ca8so15580915otk.6; Wed, 08 Jun 2022 10:24:30 -0700 (PDT) X-Gm-Message-State: AOAM533EUu3BGtj357OwO/WMSp3qm+0CbPWFpJE2+9kr/zVjDj1WkpD+ 5a38+uXVXBpVGUS687vphLGwbCXYC7lR+l+mdiw= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King - ARM Linux , Hans Ulli Kroll , Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , Xuerui Wang , Geert Uytterhoeven , Sam Creasey , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, Pv-drivers , Boris Ostrovsky , Chris Zankel , Max Filippov , Rafael Wysocki , Len Brown , Pavel Machek , gregkh , Michael Turquette , Stephen Boyd , Daniel Lezcano , lpieralisi@kernel.org, Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jonathan Hunter , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , Sergey Senozhatsky , John Ogness , "Paul E. McKenney" , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, alpha , Linux Kernel Mailing List , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , linux-omap , linux-csky@vger.kernel.org, "open list:QUALCOMM HEXAGON..." , "open list:IA64 (Itanium) PLATFORM" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Openrisc , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , Linux-sh list , sparclinux , linux-um , linux-perf-users@vger.kernel.org, "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , xen-devel , "open list:TENSILICA XTENSA PORT (xtensa)" , ACPI Devel Maling List , Linux PM list , linux-clk , linux-arm-msm , "open list:TEGRA ARCHITECTURE SUPPORT" , linux-arch , rcu@vger.kernel.org X-Provags-ID: V03:K1:f6MAODVQwFkToD8ZGpqqcR3LRuigXpfReJhIPMngEtPmqsMWofe 78RnVl4NShqaQgs/AVTS7tMb2ioFh5aVPt4++vDQxUQcydgxgJBW8TJMd0VgNAgJLo32c/H Jj+a6Fp3ANaCMMz4mkg7xwAKHZp6Udx3k7q4qu0V0Udsj0v7KUfkJrtAFNfJYgQMbtcg/IL HnAjMcOyeHK5HCcpjrAAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uT361sUFDfU=:tv7w5GiHwaOr0cKSBewb9p BAWthbAejv9MMjr/CiBGdlOabpK7tgd09zdPLQixsZ9eLvM4uAWLUXoX/XHRwnqzrLuahSl++ yXtPnG79HntP7DmRn1+EXts61xmQ4mQhAChPSSMjKotXO1/aDR+4z7Mymp9C6f/aY+BtLp9Bv psoHXmqoNIVzoIRlysvMfOgpEeBe+nFsVAGZmXeK4eb8BsLYnCjdTeV7j8MJkjYtPccLLhB+6 5NBNX3E2OZpiOQcnKd36duk7KVcudKYOh+MHWKx1PIKAo2bID8FbXAzq2EhuFOMlNiBIZ5w6K THGrNRNMayBGlJzY/pktlh1kRcS3uV6IfiytF/gJmxcXot1B9zJIRQyjI76xB9SKfUJLKtPcZ KAB72hULrX/9hybQANLkc8htPOBMBKiK+7YNKXGFaKxLGy+r08Rki4qfFlZGChXooVyJBW7LE BFH0hK/Dl6/dzljp3QRhY6Ce0fJVQhwUZ2TSL07gsNKPEa0d0MiSGo+TuE8/KhRmUZhb3OKzW 3SqmTZ/Eem4Gx0k1Vo3XAa12k7h/RVCkG4HOL9/ZF/qt4P53PD8o3i4Uk0I62Yg900gl5dmo5 55r6Kjqkwg28bjrLgCGaZkYZKlpMRh0pfotbomQFblsW8UG13+qafzmTcRV+CurmXvvvNcRRQ 2KRRWGfCGqIAMBXgaQPmUaUVXHIhEXUSLzvVb1I1B3wZDfUHGqH76FJHhI3m0+emItHMMflvr oCWdD1TQb3RUnsj9A7ObGXCj/fa4+So46APLzOYhQraeKagrekkZjHlj6xIIj9Bgr9v5/bYyT UT/jMXs1db1EW2trQuBHkGJ48AG3eCg8gTlciHXD9WaY681tXUsIm7CmDDvGJvrvDB7XrrZbH TzmXC2ZzRjRuxnTue2uw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_102437_566568_F248EE33 X-CRM114-Status: GOOD ( 17.56 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0760CC43334 for ; Wed, 8 Jun 2022 20:23:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 921FA83E15; Wed, 8 Jun 2022 20:23:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ajLwydfZaPA; Wed, 8 Jun 2022 20:23:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1D43981254; Wed, 8 Jun 2022 20:23:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D6E35C0039; Wed, 8 Jun 2022 20:23:15 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 33B27C002D for ; Wed, 8 Jun 2022 20:23:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1802D419B9 for ; Wed, 8 Jun 2022 20:23:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h7gqIR7YCIek for ; Wed, 8 Jun 2022 20:23:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by smtp4.osuosl.org (Postfix) with ESMTPS id B8DC241974 for ; Wed, 8 Jun 2022 20:23:13 +0000 (UTC) Received: from mail-ot1-f41.google.com ([209.85.210.41]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1M9ZRc-1o4XzG1oxA-005blU for ; Wed, 08 Jun 2022 22:23:10 +0200 Received: by mail-ot1-f41.google.com with SMTP id w19-20020a9d6393000000b0060aeb359ca8so15911946otk.6 for ; Wed, 08 Jun 2022 13:23:09 -0700 (PDT) X-Gm-Message-State: AOAM531az9BTAL6oS4hkuW439CpGDu6uEQY+F9vpjNcyxH9DN55gl4HQ M17dr4Nzefsh4XxjzKX0sAoQLNrhKYnHl3Kw7PQ= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra X-Provags-ID: V03:K1:e6NLLVOTCfI5J5o9DqhayBw8ZPRSYyM8kG6DeAJgju2+38XLZr8 dCouy5BJzyRXwEU1AQw9AX+5dnMM3vWAJt5K7Zln12wSndB7nrOFlACOpnURlYtTpv8ui1l MEQYor+bOHg1Ji41DR3pYk2acg0YjYBhIhzPuzpw2t7URBtpSfYz0tW36uwPKwm0uZXwYrN ulat1Gl+pbfvFg4KzgYsA== X-UI-Out-Filterresults: notjunk:1;V03:K0:JHI9O7Jkx5Y=:V3h5aFxY4V/LGlus1C1rKD LhQb5DGOS1aglOopvD8ytO6bS33oqs751YBC4ua3vuPfWsQBj8VRFOeG/UUnzukfN9MzwN+hv 9tgPY6XkAsDToxQXG/uUo+Vn12Kt/pMlunH8K8Bg6z7eNlZAsyVCcg0/H/ph5233DPu9dfLj1 bbo+V2iO+uT4G/7qlO4G+WPeMCMhZRVV7ibwKreA0EKbH+t3wX0aor7NPZSIgarZ6oOwBvll+ atcVolxJF8OWlyOXQKjV7wHu7sIBFt7TjW9h8HDx5QoysKwi7uMBOjg5RPKkI7jN298Dl+5I8 ydkCkaYfHz8lmISPVUoqDPi4A84WZ0mFI2Mm/2GwEYneqkfXdy7+JTHSyn4gnJ9GPNphETtWs BxjhF70ZmIJ+6XdbeOk9P4I0nAlpowMGOAHwCbpsy+QsZ21uwlcXkJEnFMDP5J3mjOVXkHZxz 395SLQqrpSP/AUeCTL7Es6HeYl7RvPa0fFlLuF+ojATCg/medmaL3xoQ63VQvx3vs3ov3H4uf U9XnLgukunyTsL74YJLWJpS4jE2BpKwCM/kzdq6Q7pKRKToNLB3F5Pd4McHCY+QU/JqnoOGG2 3j42a7e4cj6M8ARSImHJOiBF+/OKWqlX6G+sBMEr94hUZJb7SATS5QM2xU15Vi664jdwy3V4Z wSZuFyOgq2PpawMgZ34TbUfjj2nn5zgoDpkjLRZyVqkYEnsrw54OY8FFDzeU+xMlBwNR7v9tm bZ6oxRRdwQ6MpECw9cPt6j9TgZzBXWYo8aOfWUDeN9EDp3hJvN1dwa7TB+5zOiLSbILqqIEr7 x8H3Rhgrq0TgwRZ4tTuG63Ftb03wSu3bXYEX4g43nTRX8ii9meyPYISnQPFAfoZqtj9BVkoLa 2BY67d6K0mMCefwxtr/Q== Cc: Juri Lelli , Rafael Wysocki , Benjamin Herrenschmidt , Linus Walleij , Ben Segall , Guo Ren , Pavel Machek , Alexander Gordeev , linux-arch , Vincent Guittot , Michael Ellerman , Huacai Chen , ACPI Devel Maling List , Andy Gross , Geert Uytterhoeven , NXP Linux Team , Catalin Marinas , xen-devel , Matt Turner , Michael Turquette , Sam Creasey , Petr Mladek , Linux PM list , Lai Jiangshan , Sascha Hauer , linux-um , Arnaldo Carvalho de Melo , Thomas Gleixner , linux-omap , Dietmar Eggemann , Richard Henderson , gregkh , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, Sergey Senozhatsky , Sven Schnelle , Jiri Olsa , Paul Mackerras , Mark Rutland , "open list:IA64 \(Itanium\) PLATFORM" , Dave Hansen , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , James Bottomley , Max Filippov , Thierry Reding , Xuerui Wang , quic_neeraju@quicinc.com, linux-s390 , vschneid@redhat.com, John Ogness , Yoshinori Sato , Linux-sh list , Fabio Estevam , Helge Deller , Daniel Lezcano , Jonathan Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Sascha Hauer , Vasily Gorbik , linux-arm-msm , alpha , linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , Dinh Nguyen , Daniel Bristot de Oliveira , Alexander Shishkin , lpieralisi@kernel.org, Rasmus Villemoes , Joel Fernandes , Will Deacon , Boris Ostrovsky , Kevin Hilman , linux-csky@vger.kernel.org, Pv-drivers , "open list:SYNOPSYS ARC ARCHITECTURE" , Mel Gorman , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Hans Ulli Kroll , Vineet Gupta , linux-clk , Josh Triplett , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Tony Lindgren , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux , "open list:QUALCOMM HEXAGON..." , linux-riscv , Anton Ivanov , Jonas Bonn , Yury Norov , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , Stefan Kristiansson , Openrisc , Paul Walmsley , "open list:TEGRA ARCHITECTURE SUPPORT" , Namhyung Kim , Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , Michal Simek , "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7CC6CCA47A for ; Wed, 8 Jun 2022 21:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235054AbiFHVZc (ORCPT ); Wed, 8 Jun 2022 17:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234294AbiFHVZY (ORCPT ); Wed, 8 Jun 2022 17:25:24 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A3F19799D; Wed, 8 Jun 2022 14:25:20 -0700 (PDT) Received: from mail-yb1-f173.google.com ([209.85.219.173]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MNc1T-1oNa4K0QrT-00P2e5; Wed, 08 Jun 2022 23:25:19 +0200 Received: by mail-yb1-f173.google.com with SMTP id s39so11077928ybi.0; Wed, 08 Jun 2022 14:25:16 -0700 (PDT) X-Gm-Message-State: AOAM533ccHmRHAtjzIENuM22dhcJwyw6Hc9WOvf6/we8Lwl3909SSkO9 yJ1qPPUY++2J0XerrodTaoB3zDcjNnsRmNA1OYw= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King - ARM Linux , Hans Ulli Kroll , Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , Xuerui Wang , Geert Uytterhoeven , Sam Creasey , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, Pv-drivers , Boris Ostrovsky , Chris Zankel , Max Filippov , Rafael Wysocki , Len Brown , Pavel Machek , gregkh , Michael Turquette , Stephen Boyd , Daniel Lezcano , lpieralisi@kernel.org, Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jonathan Hunter , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , Sergey Senozhatsky , John Ogness , "Paul E. McKenney" , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, alpha , Linux Kernel Mailing List , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , linux-omap , linux-csky@vger.kernel.org, "open list:QUALCOMM HEXAGON..." , "open list:IA64 (Itanium) PLATFORM" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Openrisc , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , Linux-sh list , sparclinux , linux-um , linux-perf-users@vger.kernel.org, "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , xen-devel , "open list:TENSILICA XTENSA PORT (xtensa)" , ACPI Devel Maling List , Linux PM list , linux-clk , linux-arm-msm , "open list:TEGRA ARCHITECTURE SUPPORT" , linux-arch , rcu@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:ULl6cVPERAdL9PyvM7zONDpiWVA4ZyVCOCwcYzHyZ73ntMV0dXB Qnmv/scTxLAGN5u/O+hL+EvSWO+2o8nUrHr2/SapIIJB48TQzNuq7Qo4YjkkFjKlpP+8WrN 4s3kxn7SJ8r4HuxEedkCiCX/mZHBl+eq1ayzzhuhSO7yKbwkoJTbbR4YNjb9FqeLSzEM19Q Mc4EFUXFXKH6dwoj9trfQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:grSfKAphyzs=:I2pHeW7GZh5+m3dVZkq2mK h1vxzn78vi6v74anukEMbJA1NmbhPJsQ61amenlQ+l0eulwQnAphYlpg9L/wLMXysg2mrtIGl Gp6gy8nUKSm98lf1bCp1OxghGzjwMcNPmNXf5rYaGmYlJ302EfJJIkdXy8WIyogSODZwIx/bz 3f+Nsz1yJK25RbaEF/EZbTgAlScnruIzkAQVSYdXSD4p8hwt9yyxpxEdwpWFME0gZVyl0Madr CnUhu1DEnNYkWJFwfn7u8hClLiS4MEG6k3Ky2lXVWaR6SiADuD0pKXkSs2enFIUKnR+gYR0Wg dAGrhJOqTbTrQrgegZe1uqIvesGeKPhJompxYd4WbtuGF6eRQ34yEbu25ehPmNTRuz/E4/1qj bJUCwmofNaGObBLn+2Y9Hhm8AzONXvsj0IRq/m7qjUM1HW6+qOAZ6w07tpskpivABnTlBAoJR WGVCRozSSODlc+KobCiXeme9quMYCEj/FNJXz+OvOOk3tq2oFvCGV5W1Q8ARC9voBU+Xfy07W PIM4H4LdTHtBpF8FRkPrLY/V0M0nCbnMVyrgdDfMDJIt2aIL7LVsvK0v1GiSmU7WpSftyf7Bj 9ITI5IZa5QnwqoB5fpLA2b3ZFrZyWarhYbocWot6ttZMKakPG8BWsAGlDPmiDLIMcJsMcbXaT /dy88hAw+iE4MJDule9bvMH3EWaEWM1eitRY4U1FocIBhFqhIs92e2Eb27yRQvF7HJ7vm9Cwk JAIdAD3nS81Vjs1JQiiVSKI3+N63yI7FxXR9SIi14rGMtCP8uYH1U/2a3Vjo0x54NTLCjRYe8 +QzdDdWQFo6qvnBiB98ReMOXm3z+vjpl1jmW9gc9BS/K/v5869ib5kHyzx2wjbkj2SN04il97 QjAJudU8GsAAsFtr5+6CJL724hA/0VuLfc4wXv+9Q= Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AE31C43334 for ; Wed, 8 Jun 2022 22:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YIMd22AGiXzOqsFnCVqYLsCRJ4S+L3PDMTnlbUbgdoQ=; b=M88XGcGu9mGtqs k/RZyk2kLCHpsYKn+FJRiUH75407nROfHnQUxDFtvlIqXQwbHw/ALuV+uLyB9Ku58IzxMVtN1xQNR wzhvOV5ZyWVS8fa9rxAtUYcAQvMCb/4dyk5zUuUSPDcFwKg1OQWlGIsPedR5XYUPX+Z4WI3KJ4MaP SZmwmDidXzERwb3dXuXxUqKxrxNLRGZdR7bJaTAMTnrv9eGSc4NjRhqgPVazgMO9XqpenGbyq4MuE WmiGifa+BzlBFIx51bJ+o+jQ42Bcv/15F5DeOZMLXnCOjU612Q5/UlYaZz3hmMH8djaZ8H7JvfGzv pjAMej2Ip6Pt0spH7CbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz3lV-00F6Kl-L9; Wed, 08 Jun 2022 22:03:01 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyzQ5-00EUPH-6T; Wed, 08 Jun 2022 17:24:38 +0000 Received: from mail-ot1-f52.google.com ([209.85.210.52]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M6VNX-1o5pyg0jMH-006xVW; Wed, 08 Jun 2022 19:24:31 +0200 Received: by mail-ot1-f52.google.com with SMTP id w19-20020a9d6393000000b0060aeb359ca8so15580915otk.6; Wed, 08 Jun 2022 10:24:30 -0700 (PDT) X-Gm-Message-State: AOAM533EUu3BGtj357OwO/WMSp3qm+0CbPWFpJE2+9kr/zVjDj1WkpD+ 5a38+uXVXBpVGUS687vphLGwbCXYC7lR+l+mdiw= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King - ARM Linux , Hans Ulli Kroll , Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , Xuerui Wang , Geert Uytterhoeven , Sam Creasey , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "the arch/x86 maintainers" , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, Pv-drivers , Boris Ostrovsky , Chris Zankel , Max Filippov , Rafael Wysocki , Len Brown , Pavel Machek , gregkh , Michael Turquette , Stephen Boyd , Daniel Lezcano , lpieralisi@kernel.org, Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jonathan Hunter , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , Sergey Senozhatsky , John Ogness , "Paul E. McKenney" , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, alpha , Linux Kernel Mailing List , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , linux-omap , linux-csky@vger.kernel.org, "open list:QUALCOMM HEXAGON..." , "open list:IA64 (Itanium) PLATFORM" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Openrisc , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , Linux-sh list , sparclinux , linux-um , linux-perf-users@vger.kernel.org, "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , xen-devel , "open list:TENSILICA XTENSA PORT (xtensa)" , ACPI Devel Maling List , Linux PM list , linux-clk , linux-arm-msm , "open list:TEGRA ARCHITECTURE SUPPORT" , linux-arch , rcu@vger.kernel.org X-Provags-ID: V03:K1:f6MAODVQwFkToD8ZGpqqcR3LRuigXpfReJhIPMngEtPmqsMWofe 78RnVl4NShqaQgs/AVTS7tMb2ioFh5aVPt4++vDQxUQcydgxgJBW8TJMd0VgNAgJLo32c/H Jj+a6Fp3ANaCMMz4mkg7xwAKHZp6Udx3k7q4qu0V0Udsj0v7KUfkJrtAFNfJYgQMbtcg/IL HnAjMcOyeHK5HCcpjrAAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uT361sUFDfU=:tv7w5GiHwaOr0cKSBewb9p BAWthbAejv9MMjr/CiBGdlOabpK7tgd09zdPLQixsZ9eLvM4uAWLUXoX/XHRwnqzrLuahSl++ yXtPnG79HntP7DmRn1+EXts61xmQ4mQhAChPSSMjKotXO1/aDR+4z7Mymp9C6f/aY+BtLp9Bv psoHXmqoNIVzoIRlysvMfOgpEeBe+nFsVAGZmXeK4eb8BsLYnCjdTeV7j8MJkjYtPccLLhB+6 5NBNX3E2OZpiOQcnKd36duk7KVcudKYOh+MHWKx1PIKAo2bID8FbXAzq2EhuFOMlNiBIZ5w6K THGrNRNMayBGlJzY/pktlh1kRcS3uV6IfiytF/gJmxcXot1B9zJIRQyjI76xB9SKfUJLKtPcZ KAB72hULrX/9hybQANLkc8htPOBMBKiK+7YNKXGFaKxLGy+r08Rki4qfFlZGChXooVyJBW7LE BFH0hK/Dl6/dzljp3QRhY6Ce0fJVQhwUZ2TSL07gsNKPEa0d0MiSGo+TuE8/KhRmUZhb3OKzW 3SqmTZ/Eem4Gx0k1Vo3XAa12k7h/RVCkG4HOL9/ZF/qt4P53PD8o3i4Uk0I62Yg900gl5dmo5 55r6Kjqkwg28bjrLgCGaZkYZKlpMRh0pfotbomQFblsW8UG13+qafzmTcRV+CurmXvvvNcRRQ 2KRRWGfCGqIAMBXgaQPmUaUVXHIhEXUSLzvVb1I1B3wZDfUHGqH76FJHhI3m0+emItHMMflvr oCWdD1TQb3RUnsj9A7ObGXCj/fa4+So46APLzOYhQraeKagrekkZjHlj6xIIj9Bgr9v5/bYyT UT/jMXs1db1EW2trQuBHkGJ48AG3eCg8gTlciHXD9WaY681tXUsIm7CmDDvGJvrvDB7XrrZbH TzmXC2ZzRjRuxnTue2uw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_102437_566568_F248EE33 X-CRM114-Status: GOOD ( 17.56 ) X-Mailman-Approved-At: Wed, 08 Jun 2022 15:02:58 -0700 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list 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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 Received: from mail.librecores.org (lists.librecores.org [88.198.125.70]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F44CCA47A for ; Wed, 8 Jun 2022 23:00:35 +0000 (UTC) Received: from [172.31.1.100] (localhost.localdomain [127.0.0.1]) by mail.librecores.org (Postfix) with ESMTP id 48049249BC; Thu, 9 Jun 2022 01:00:34 +0200 (CEST) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by mail.librecores.org (Postfix) with ESMTPS id 04E99249B2 for ; Wed, 8 Jun 2022 22:27:50 +0200 (CEST) Received: from mail-yb1-f169.google.com ([209.85.219.169]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M3lgL-1nzJGH1Fz9-000ukY for ; Wed, 08 Jun 2022 22:27:50 +0200 Received: by mail-yb1-f169.google.com with SMTP id v22so38438227ybd.5 for ; Wed, 08 Jun 2022 13:27:50 -0700 (PDT) X-Gm-Message-State: AOAM532YWUAOGs/l4eC3soUe3m1JVTOfSYCWBVSJ1YcAtabw7DwYUeOI 8cyW8jQRln+AXlPImSiCpsHVaXzGPXOBYW2LJ8s= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:rElXuRyH0LOUF4iUItu+bNIuTciJWdtdE77ACXG88dnLuYCZ81z 4cO422lmnEJafrHQ+JvxuGCKr7rvu5N61oXJyiIznEIMm9MveX8O+WKF2dXnrHZR0hbE2hM yluFNHQ7ESqLZ4a+sUNeGJ0Vn8yIvtioKcaMIlIXAqnQzi7fY94ARFEZEC7jdW9yVIWlIHc 8Asb9iCVtDzysbcKp2CbA== X-UI-Out-Filterresults: notjunk:1;V03:K0:xEf9Q2Pc8LM=:dMNUstRn7d3bmDmU8dHlW2 vfC25pKWT4lfqHEDLeMQ4ocwbJikWd6+7jXh5110rb/tPbYUrXSsUofIZvNpVQkDMbFZHTyiz sjkaypemuX8ucOVNZLbQmzSZebXOJpdi688GrIwNM/zmJaLG982EWCHq8kIJOfKQI13rqRb+t TWX551akj+GINcYqLyk4EeNJSBKEVk1nsiJPoGdOQvfNa3m0JOHi4jhdbp/V7G9kRAcuV7ZEa UPi9GUzdPagGEI6MKcGzCPFcDHtnCmOuWk8dDNETe93Mz/dB4DrG/REgDAI8qJl9lmQT7HMvI cq8geKDl3ymvR96FZWkdkU6nAUf06Kc1N4WUHWgwXMiut2u1SZD6lptBEAT4W+xaq9E2mRgDm mu6PKZ6mFYRccg7sD2gbwCLY1TJklfsjiinBeQhwwseJx9zKdkf8pN9tlGTg87RnTxWQJ5cuO zj8+otwHkgY61ETWl2y8X1t7+1dqSV0FeK5fbCLG5f4FbSyR3ku6+N0B2klUQSU2iQvfjXt55 1dpt18A13IlMOTDvSo4Bsqz9OhW+mgCxSnXzkuQw85+6MU0n7I/PCEZ15MO5BDz29vgWXsVZ6 D7M/x5P+XMfY6l+l1TbygsaWpWMRQnkAqNVlHko729bEMI17+pZnrdgVkyMDriipJhJRZ7462 iCVB2BlkObqp89f9sHq301efQt8pCdnOat+iKt12wLEOx3efrl1epvpaKwBlh9nhW/3Ptu3da YBSbN7LdV9q1bX7bubY5+SaD+eC9iWOOrzLQExWh+RBPqT1OfBf6CZ+YswqWgd3iG621aVGM5 ++wZNzi1JzG+qkjrCCvFIuJvGUB3sLvMV/pz9WuWpoHQvPpj3dykzAMnt2ZLBPdUww1FbvuEa rezt521+mI6vQ4znFAIdQWhmjsnhPWwnX5j2RDS/s= X-Mailman-Approved-At: Thu, 09 Jun 2022 00:59:57 +0200 X-BeenThere: openrisc@lists.librecores.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion around the OpenRISC processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Rafael Wysocki , Benjamin Herrenschmidt , Linus Walleij , Ben Segall , Guo Ren , Pavel Machek , Alexander Gordeev , srivatsa@csail.mit.edu, linux-arch , Vincent Guittot , Michael Ellerman , Huacai Chen , ACPI Devel Maling List , Andy Gross , NXP Linux Team , Catalin Marinas , xen-devel , Matt Turner , Christian Borntraeger , Michael Turquette , Sam Creasey , Petr Mladek , Linux PM list , Lai Jiangshan , Sascha Hauer , linux-um , Arnaldo Carvalho de Melo , Thomas Gleixner , linux-omap , Dietmar Eggemann , Richard Henderson , gregkh , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, Sergey Senozhatsky , Sven Schnelle , Jiri Olsa , Paul Mackerras , Mark Rutland , "open list:IA64 \(Itanium\) PLATFORM" , Dave Hansen , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , James Bottomley , Max Filippov , Thierry Reding , Xuerui Wang , quic_neeraju@quicinc.com, linux-s390 , vschneid@redhat.com, John Ogness , Yoshinori Sato , Linux-sh list , Fabio Estevam , Helge Deller , Daniel Lezcano , Jonathan Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Sascha Hauer , Vasily Gorbik , linux-arm-msm , alpha , linux-m68k , Linux ARM , Chris Zankel , Stephen Boyd , Dinh Nguyen , Daniel Bristot de Oliveira , Alexander Shishkin , lpieralisi@kernel.org, Rasmus Villemoes , Joel Fernandes , Will Deacon , Boris Ostrovsky , Kevin Hilman , linux-csky@vger.kernel.org, Pv-drivers , "open list:SYNOPSYS ARC ARCHITECTURE" , Mel Gorman , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Hans Ulli Kroll , Vineet Gupta , linux-clk , Josh Triplett , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Tony Lindgren , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux , "open list:QUALCOMM HEXAGON..." , linux-riscv , Anton Ivanov , Jonas Bonn , Yury Norov , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , Openrisc , Paul Walmsley , "open list:TEGRA ARCHITECTURE SUPPORT" , Namhyung Kim , Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , Michal Simek , "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev Errors-To: openrisc-bounces@lists.librecores.org Sender: "OpenRISC" On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A2C3C433EF for ; Thu, 9 Jun 2022 00:24:38 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LJPx05ptPz3hnB for ; Thu, 9 Jun 2022 10:24:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=arndb.de (client-ip=212.227.126.135; helo=mout.kundenserver.de; envelope-from=arnd@arndb.de; receiver=) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LJLhT1930z3blw for ; Thu, 9 Jun 2022 07:58:31 +1000 (AEST) Received: from mail-ot1-f53.google.com ([209.85.210.53]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MfbwW-1nWZVT13RA-00g2vU for ; Wed, 08 Jun 2022 23:58:27 +0200 Received: by mail-ot1-f53.google.com with SMTP id a8-20020a05683012c800b0060c027c8afdso5826979otq.10 for ; Wed, 08 Jun 2022 14:58:26 -0700 (PDT) X-Gm-Message-State: AOAM533EQBFb0KS0Ylsfbola1Tl3zK7Z3dAz5mq53RLAiMRNn7AjS5sC zc+QorcJjHN6Dutlfa+atyBjjSCOa3mEtJqc8U4= X-Google-Smtp-Source: ABdhPJzN5kbTwiXruPcKSpnmqojFIl1cGQUBuhNCCdRneCrpSwm0deMOGKvKLmavgOJ05DHkpAoCHNV4Fm5CQu/QOU4= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr36982567ywe.42.1654705351589; Wed, 08 Jun 2022 09:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> From: Arnd Bergmann Date: Wed, 8 Jun 2022 18:22:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour To: Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:jhsOR2OLfEmtFaGCck8aElezQtAMAi/hp+7qXSaB7Z4R8W6cVKU RgDhJc+l4tbYnMAolFNf26sMPZWodHmepks0bpyhsqzSLZYwZ6g3kIJcH3mouFTkTmqNQU6 B6OWadRb41yTO4udEW+Zf99UGMn247cYioL9kHQFGFXVAhEabMbxU+30/bVV/7GjZUcqaJi NHquoaXYq/R1JbiRYoN6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:BvwcjheZQHU=:dK57Ic+Qi5v+yeD8gmMa54 PVKCuMuFDO8RVNeOEMLtuZzcnhqZ+DKLFFRj8tPEx9rtFatctgh6U29DJ9IrAovFObYnu2FdX 6y/g8UTRl7fhCOianzyyDdab2KoERSUlBLqaKjBC4un+RbqZdcMcX0nUhH+Jocm5VGz88YkV2 sfb+DNNW12jDKZUej4cjJpyU+ztG0OhBxi44LFa8/MWW0XLOvyEjy1SJKvCKo6zFJNQfUCm8D kHt5q8ccSS4azAyW8xvNDg3GlXfiH9JnH/jyP/Jx6Deqf0yLNGNpIY5TZCI15t9usxDHClIH6 4WLdylDRssRBUkzDdz7IR4T5aC0JeTqX65WjGr/MufFgMA2nC/lvsYBzrXajjHRrbkey51pIN CkA/QAbVqNN1yibOMLpW3JbQNazlfdH7OL3CK6Sm5n5G+gg90lB1hlyeJqLLBcW0kt9dms+q5 Vfo3mmWnZwrTmwhL8b4NQuEZa5fIu5MwhuFvE1BU6Nsc95WQg//T8MUx7FB4+fUJmHnVzzPPH 88gtm6zvnBxb9aJ+s8wF/EEHJCdLtl8di0v4cNBbB64yOUfr5wawt4DODacUAtPJ26OKFWniB tkcCE0euO+82/kGJ4DcDjx2bbeDh4tfHhIVcrvldZM0L3PHzGLR9jatQXoVy4B64+6ClimXb+ eHwnGlYSKmyGojCvNT5/06i4NijIhPuGBKZJiDgEWLa7H+mIGDJe5ZxrlH1OXA5LSRv1O6uUD z44mV+9SM1CoWrFUA3N/1/a85lPYrJ8u2wP7rYetNqQwl5SG+rNYaow8AiFyKQiW9kKq+Lxrk Vy7ETR8+Ikv7Uf/aM7NLxWvtddHMu9ikyPPZkq0J7z8Zh4WrYVproxd8yFeM17WToL3S20Lu3 iLCdWtU3Vs+0/Av5ljAF0efMuZRQ2d1QMI8oqRD6r4WRE8ni/FG9McfSfkI0LYdIeKG/mjHu9 U7PnABqgBH1OdwhxSGWgg6bSfTFQcv11UWu+A203ScM49+1kzR7ei X-Mailman-Approved-At: Thu, 09 Jun 2022 09:55:19 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , Rafael Wysocki , Linus Walleij , Ben Segall , Guo Ren , Pavel Machek , Alexander Gordeev , srivatsa@csail.mit.edu, linux-arch , Vincent Guittot , Huacai Chen , ACPI Devel Maling List , Andy Gross , Geert Uytterhoeven , NXP Linux Team , Catalin Marinas , xen-devel , Matt Turner , Christian Borntraeger , Michael Turquette , Sam Creasey , Petr Mladek , Linux PM list , Lai Jiangshan , Sascha Hauer , linux-um , Arnaldo Carvalho de Melo , Thomas Gleixner , linux-omap , Dietmar Eggemann , Richard Henderson , gregkh , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org, Sergey Senozhatsky , Sven Schnelle , Jiri Olsa , Paul Mackerras , Mark Rutland , "open list:IA64 \(Itanium\) PLATFORM" , Dave Hansen , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , James Bottomley , Max Filippov , Thierry Reding , Xuerui Wang , quic_neeraju@quicinc.com, linux-s390 , vschneid@redhat.com, John Ogn ess , Yoshinori Sato , Linux-sh list , Fabio Estevam , Helge Deller , Daniel Lezcano , Jonathan Hunter , Mathieu Desnoyers , Frederic Weisbecker , Len Brown , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Sascha Hauer , Vasily Gorbik , linux-arm-msm , alpha , linux-m68k , Stafford Horne , Linux ARM , Chris Zankel , Stephen Boyd , Dinh Nguyen , Daniel Bristot de Oliveira , Alexander Shishkin , lpieralisi@kernel.org, Rasmus Villemoes , Joel Fernandes < joel@joelfernandes.org>, Will Deacon , Boris Ostrovsky , Kevin Hilman , linux-csky@vger.kernel.org, Pv-drivers , "open list:SYNOPSYS ARC ARCHITECTURE" , Mel Gorman , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Hans Ulli Kroll , Vineet Gupta , linux-clk , Josh Triplett , Steven Rostedt , rcu@vger.kernel.org, Borislav Petkov , bcain@quicinc.com, Thomas Bogendoerfer , Parisc List , Sudeep Holla , Shawn Guo , David Miller , Rich Felker , Tony Lindgren , amakhalov@vmware.com, Bjorn Andersson , "H. Peter Anvin" , sparclinux , "open l ist:QUALCOMM HEXAGON..." , linux-riscv , Anton Ivanov , Jonas Bonn , Yury Norov , Richard Weinberger , the arch/x86 maintainers , Russell King - ARM Linux , Ingo Molnar , Albert Ou , "Paul E. McKenney" , Heiko Carstens , Stefan Kristiansson , Openrisc , Paul Walmsley , "open list:TEGRA ARCHITECTURE SUPPORT" , Namhyung Kim , Andy Shevchenko , jpoimboe@kernel.org, Juergen Gross , Michal Simek , "open list:BROADCOM NVRAM DRIVER" , Palmer Dabbelt , Anup Patel , Ivan Kokshaysky , Johannes Berg , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Wed, 08 Jun 2022 16:22:12 +0000 Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour Message-Id: List-Id: References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> In-Reply-To: <20220608144517.188449351@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Peter Zijlstra Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King - ARM Linux , Hans Ulli Kroll , Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , Xuerui Wang , Geert Uytterhoeven , Sam Creasey , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , James Bottomley , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , David Miller , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , the arch/x86 maintainers , "H. Peter Anvin" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Juergen Gross , srivatsa@csail.mit.edu, amakhalov@vmware.com, Pv-drivers , Boris Ostrovsky , Chris Zankel , Max Filippov , Rafael Wysocki , Len Brown , Pavel Machek , gregkh , Michael Turquette , Stephen Boyd , Daniel Lezcano , lpieralisi@kernel.org, Sudeep Holla , Andy Gross , Bjorn Andersson , Anup Patel , Thierry Reding , Jonathan Hunter , jacob.jun.pan@linux.intel.com, Arnd Bergmann , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Steven Rostedt , Petr Mladek , Sergey Senozhatsky , John Ogness , "Paul E. McKenney" , Frederic Weisbecker , quic_neeraju@quicinc.com, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , vschneid@redhat.com, jpoimboe@kernel.org, alpha , Linux Kernel Mailing List , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , linux-omap , linux-csky@vger.kernel.org, "open list:QUALCOMM HEXAGON..." , "open list:IA64 (Itanium) PLATFORM" , linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Openrisc , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , Linux-sh list , sparclinux , linux-um , linux-perf-users@vger.kernel.org, "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , xen-devel , "open list:TENSILICA XTENSA PORT (xtensa)" , ACPI Devel Maling List , Linux PM list , linux-clk , linux-arm-msm , "open list:TEGRA ARCHITECTURE SUPPORT" , linux-arch , rcu@vger.kernel.org On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour Date: Wed, 8 Jun 2022 18:22:12 +0200 Message-ID: References: <20220608142723.103523089@infradead.org> <20220608144517.188449351@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TApYdMgHAH3Az6LnedImzAIwieBInDFK7MwFAA4T1mI=; b=KYf2qB7xypUAEH gNKCXVxYy1A2ExIq8juvETQWmbPySxJA7EyJ8O1ESuQj3Rbs4Of99HIrs6ASY5K2w+BRnQxAmUSZH eO5wMg/9DJOlnHvPHrxZxd66rNbQ3fSMIH7Ppnsp+Q7K1tB05AvP8C62aybJSHilKVsUpbX0WdRIC i50c24WfbEWUhX89NdhlKqaX2XxPKyQHu5bSy4ojErx70+KlgW70dwhQL+Yhdjtcr3UVdOrfq7OXw EzEYv5O8aywyRWQUgc3U4UjAA6xnNr+RkI8YizwH15b76PTSM4FiHKPRjeiNbynH6BFlN7DuIUTMC wvfXAblk2zJ07iOIDOGA==; In-Reply-To: <20220608144517.188449351@infradead.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+glud-user-mode-linux-devel=m.gmane-mx.org@lists.infradead.org To: Peter Zijlstra Cc: Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King - ARM Linux , Hans Ulli Kroll , Linus Walleij , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , Tony Lindgren , Kevin Hilman , Catalin Marinas , Will Deacon , Guo Ren , bcain@quicinc.com, Huacai Chen , Xuerui Wang , Geert Uytterhoeven , Sam Creasey , Michal Simek , Thomas Bogendoerfer On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra wrote: > > Current arch_cpu_idle() is called with IRQs disabled, but will return > with IRQs enabled. > > However, the very first thing the generic code does after calling > arch_cpu_idle() is raw_local_irq_disable(). This means that > architectures that can idle with IRQs disabled end up doing a > pointless 'enable-disable' dance. > > Therefore, push this IRQ disabling into the idle function, meaning > that those architectures can avoid the pointless IRQ state flipping. > > Signed-off-by: Peter Zijlstra (Intel) I think you now need to add the a raw_local_irq_disable(); in loongarch as well. Arnd