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 2CDC8CCD184 for ; Tue, 14 Oct 2025 17:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VZuzQ0vfYo67YZ87oaUHAzzbmOUfmnTfkoYeXMCcF+8=; b=T7RC9xTeLkgKukjk7dc8v6YdmA JCJw/KGoz2zoBOPBawTfYqVVDCF93sA15/C7fMbpPTDphss8xvRIBDHaSwFqrULgbxS+hdkP7/Fx3 v/wBEWOUZanKm/k5F0ioa0c0m34U/SkUQm2WQFFq2Sm31hNqEYNpotIwgoS4/DTxd1Dmju1tWN/Vn VLPy0VGHX5gcAYdI5oycVuHza4TwirQRcZplRyUoKkCQxFiKadio6ztKluKVFteKa8fz4ikhtW3kX 08HnUr//i+n2Y+jm0jCcF49h6QJf4VHq3l1JWcV+5LIXC5fIS5pflh0TkTj2Lx6qxtYwUXtdoyUsD f8iTRcSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8j6r-0000000H6e9-3oyL; Tue, 14 Oct 2025 17:46:53 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8j6q-0000000H6dv-1mX2 for linux-arm-kernel@lists.infradead.org; Tue, 14 Oct 2025 17:46:52 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D153A6237F; Tue, 14 Oct 2025 17:46:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 886DAC4CEE7; Tue, 14 Oct 2025 17:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760464011; bh=REAJKHktfM5uhBrHBHX1IL3/GQ/UWwWriUYpZT5i0i0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XlXcBMMJmLFepolcAl1W6bVqaq58HD498ZbWBeybAD42nc9rMQLs5p9VvaHyTBcPo 9DGEcIdTrGRw7egfcDmil9IEBQxq7nMTU5O2qfbpjrbfgvChGy+2GFp57FeO2lb+Zo Ed4LeSDr1dAsue6PCdN/xo6t3bgEQbfV1tIkuo1NxeAe0DP39qtrc1hb46Gwu6MaEh e5ZOAcnKaX2ZGw/fy/geGx1MBZjJyHhooKCNTRux0OLOh55GZXmm51j70H2dKyhzdf 63RB7Kjiha84VMK7NBMNrr/YMZoUzPgjg63dmC4hT0JkNcbK9ram5YmxIBDTa/hHRr Sy8lWgc5pa1NA== Received: from 82-132-215-36.dab.02.net ([82.132.215.36] helo=lobster-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v8j6n-0000000DxEH-0qIj; Tue, 14 Oct 2025 17:46:49 +0000 Date: Tue, 14 Oct 2025 18:46:40 +0100 Message-ID: <87cy6pxtof.wl-maz@kernel.org> From: Marc Zyngier To: Thierry Reding Cc: Thomas Gleixner , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: IRQ thread timeouts and affinity In-Reply-To: References: <86qzvcxi3j.wl-maz@kernel.org> <86o6qgxayt.wl-maz@kernel.org> <86ms60x7w7.wl-maz@kernel.org> <86bjmeyh5m.wl-maz@kernel.org> <87sefpoj10.wl-maz@kernel.org> <6hb5vyl5xxsxfcwk4v3xpq277wusj5jq4tubdpjocpjc5smj3w@wx574kluhedj> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 82.132.215.36 X-SA-Exim-Rcpt-To: thierry.reding@gmail.com, tglx@linutronix.de, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 14 Oct 2025 12:08:22 +0100, Thierry Reding wrote: > [...] > > The interrupt count for CPUs 2-7 no longer increments after taking CPU 1 > > offline. Interestingly, bringing CPU 1 back online doesn't have an > > impact, so it doesn't go back to enabling 1:N mode. > > Looks like that is because gic_set_affinity() gets called with the new > CPU mask when the CPU goes offline, but it's *not* called when the CPU > comes back online. Indeed, because there is no need to change the affinity as far as the kernel is concerned -- the interrupt is on an online CPU and all is well. I think that's the point where a per-interrupt flag (let's call it IRQ_BCAST for the sake of argument) is required to decide what to do. Ideally, IRQ_BCAST would replace any notion of affinity, and you'd get the scatter-gun behaviour all the time. Which means no adjustment to the affinity on a CPU going offline (everything still works). But that's assumes a bunch of other things: - when going offline, at least DPG1NS gets set to make sure this CPU is not a target anymore if not going completely dead (still running secure code, for example). The kernel could do it, but... - when going idle, should this CPU still be a target of 1:N interrupts? That's a firmware decision what could severely impact power on battery-bound machines if not carefully managed... - and should a CPU wake up from such an interrupt? Again, that's a firmware decision, and I don't know how existing implementation deal with that stuff. Someone needs to investigate these things, and work out all of the above. That will give us a set of conditions under which we could do something. M. -- Jazz isn't dead. It just smells funny.