Thread (106 messages) 106 messages, 18 authors, 2022-07-30

Re: [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour

From: Arnd Bergmann <arnd@arndb.de>
Date: 2022-06-08 21:25:37
Also in: linux-acpi, linux-alpha, linux-arch, linux-arm-msm, linux-clk, linux-m68k, linux-mips, linux-omap, linux-perf-users, linux-pm, linux-riscv, linux-s390, linux-sh, linux-tegra, linux-um, lkml, rcu, sparclinux, virtualization, xen-devel

o@users.sourceforge.jp>, Linux-sh list [off-list ref], Fabio Estevam [off-list ref], Helge Deller [off-list ref], Daniel Lezcano [off-list ref], Jonathan Hunter [off-list ref], Mathieu Desnoyers [off-list ref], Frederic Weisbecker [off-list ref], Len Brown [off-list ref], "open list:TENSILICA XTENSA PORT \(xtensa\)" [off-list ref], Sascha Hauer [off-list ref], Vasily Gorbik [off-list ref], linux-arm-msm [off-list ref], alpha [off-list ref], linux-m68k [off-list ref], Stafford Horne [off-list ref], Linux ARM [off-list ref], Chris Zankel [off-list ref], Stephen Boyd [off-list ref], Dinh Nguyen [off-list ref], Daniel Bristot de Oliveira [off-list ref], Alexander Shishkin [off-list ref], lpieralisi@kernel.org, Rasmus Villemoes [off-list ref], Joel Fernandes <
 joel@joelfernandes.org>, Will Deacon [off-list ref], Boris Ostrovsky [off-list ref], Kevin Hilman [off-list ref], linux-csky@vger.kernel.org, Pv-drivers [off-list ref], "open list:SYNOPSYS ARC ARCHITECTURE" [off-list ref], Mel Gorman [off-list ref], jacob.jun.pan@linux.intel.com, Arnd Bergmann [off-list ref], Hans Ulli Kroll [off-list ref], Vineet Gupta [off-list ref], linux-clk [off-list ref], Josh Triplett [off-list ref], Steven Rostedt [off-list ref], rcu@vger.kernel.org, Borislav Petkov [off-list ref], bcain@quicinc.com, Thomas Bogendoerfer [off-list ref], Parisc List [off-list ref], Sudeep Holla [off-list ref], Shawn Guo [off-list ref], David Miller [off-list ref], Rich Felker [off-list ref], Tony Lindgren [off-list ref], amakhalov@vmware.com, Bjorn Andersson [off-list ref], "H. Peter Anvin" <hpa@zytor.c
 om>, sparclinux [off-list ref], "open l
ist:QUALCOMM HEXAGON..." [off-list ref], linux-riscv [off-list ref], Anton Ivanov [off-list ref], Jonas Bonn [off-list ref], Yury Norov [off-list ref], Richard Weinberger [off-list ref], the arch/x86 maintainers [off-list ref], Russell King - ARM Linux [off-list ref], Ingo Molnar [off-list ref], Albert Ou [off-list ref], "Paul E. McKenney" [off-list ref], Heiko Carstens [off-list ref], Stefan Kristiansson [off-list ref], Openrisc [off-list ref], Paul Walmsley [off-list ref], "open list:TEGRA ARCHITECTURE SUPPORT" [off-list ref], Namhyung Kim [off-list ref], Andy Shevchenko [off-list ref], jpoimboe@kernel.org, Juergen Gross [off-list ref], Michal Simek [off-list ref], "open list:BROADCOM NVRAM DRIVER" [off-list ref], Palmer Dabbelt [off-list ref], Anup Patel <anu
 p@brainfault.org>, Ivan Kokshaysky [off-list ref], Johannes Berg [off-list ref], linuxppc-dev [off-list ref]
Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org
Sender: "Linuxppc-dev" [off-list ref]

On Wed, Jun 8, 2022 at 4:27 PM Peter Zijlstra [off-list ref] 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) <peterz@infradead.org>
I think you now need to add the a raw_local_irq_disable(); in loongarch
as well.

       Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help