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 02DF5CCD187 for ; Thu, 9 Oct 2025 14:31:11 +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=g0og8FuTPhaZMAi6nyNxMFk4PUdXyGoXqphR/pSJhTI=; b=RYWvTL2pTtSaOL5SUv06X7F6FO uSwvswPj19G+TBY5c48alwS81ZH23XYUBenqajGRmcJrN5UX0IxxrvUScr3CdBRxmBkkqtsyx+Pv8 VIER8xKpukJslSiG/SYp4n2KT7nAegQLjDtqWR+6PQ50/IkO7GT9nANxYqyLqseZ7B/Y4cpypwrsu Ud7z1JKSDYXMl829ohjM04x8KlMqDt8swkQ8fDOvEsI+R70khYRE/bpvH9Fs9RY2ToeaM9D+/4h37 yeJb/IodnBmlUkKMsBox1uTUe05exv1BmATzo8OMnKK+nc6ABGnDtblCH63QTORcBclaiQjwP4IHc xCh4UbWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v6rfa-00000006KoF-2JGL; Thu, 09 Oct 2025 14:31:02 +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 1v6rfY-00000006Ko9-2Es3 for linux-arm-kernel@lists.infradead.org; Thu, 09 Oct 2025 14:31:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id F03DD622F0; Thu, 9 Oct 2025 14:30:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E55DC4CEE7; Thu, 9 Oct 2025 14:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760020259; bh=by7B82JNtuWconqfgRH2IEjHTUBvVgCQlC/h4bYSBsA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dY5mvCf9PB0wbd7hHCmC15O4xQ7B/3eWJp66y7FLCawXvUAS8z8Ga4eByBfPCZnGs SMRV9o1J0xua7LV3sR0NvPuaXlqnURAuxQnVfDTlqmmNorn25JD0oOSnD3DjrMD505 8iSp5LFsUqRRDTs3Fc380LWy89ZfKzNGGJeMWOwC89bwX2YotWPNw8x/2Gu1Mp2hAa 32vXen4iDp44KhuWGJvP2a7sdVLouPubDhi7px+bbtlS1+l3BuBTfHXhfCQ95ixhKB f3KBTpvL4E0xT/nfqj/c7aJdytyvRWvMSUeKJCgayHSr7UTnDAU8WQJkybNzi6L6nI QSLDTzHSRG6GQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-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 1v6rfV-0000000CeiY-1hQI; Thu, 09 Oct 2025 14:30:57 +0000 Date: Thu, 09 Oct 2025 15:30:56 +0100 Message-ID: <86qzvcxi3j.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: 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: 185.219.108.64 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 Hi Thierry, On Thu, 09 Oct 2025 12:38:55 +0100, Thierry Reding wrote: > > Which brings me to the actual question: what is the right way to solve > this? I had, maybe naively, assumed that the default CPU affinity, which > includes all available CPUs, would be sufficient to have interrupts > balanced across all of those CPUs, but that doesn't appear to be the > case. At least not with the GIC (v3) driver which selects one CPU (CPU 0 > in this particular case) from the affinity mask to set the "effective > affinity", which then dictates where IRQs are handled and where the > corresponding IRQ thread function is run. There's a (GIC-specific) answer to that, and that's the "1 of N" distribution model. The problem is that it is a massive headache (it completely breaks with per-CPU context). We could try and hack this in somehow, but defining a reasonable API is complicated. The set of CPUs receiving 1:N interrupts is a *global* set, which means you cannot have one interrupt targeting CPUs 0-1, and another targeting CPUs 2-3. You can only have a single set for all 1:N interrupts. How would you define such a set in a platform agnostic manner so that a random driver could use this? I definitely don't want to have a GIC-specific API. Overall, there is quite a lot of work to be done in this space: the machine I'm typing this from doesn't have affinity control *at all*. Any interrupt can target any CPU, and if Linux doesn't expect that, tough. Don't even think of managed interrupts on that sort of systems... M. -- Without deviation from the norm, progress is not possible.