From nobody Wed Feb 18 16:26:55 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fGMNH5BKZz6SRjk for ; Wed, 18 Feb 2026 16:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fGMNH4XsPz3GB3 for ; Wed, 18 Feb 2026 16:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771432015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcN2v40dkxilEVidWf/l5Xv1WIg8uVuKYst4atWrRUY=; b=UAJCGmvBn5JaOYeklHEvhhqppwfeIbfcXvvZyv40oDwvsZczNI6KosecuLI3OtMlYvUct+ 0ke/RG0Dso/wpV9wKfpT6RWQHf+NACawe0OgFQEsoi/PAomuTBJ8mCYwPF2FRXG8yXo7gW zU5QX/EiBKd+wyfnF34OUCG2Dn/JYTBwMYMbpyUSM29cFfN3HqVV1YsIqT9XziAw125dK0 Zc+0vVkZQbDKwnDm+TkTwaJxEFR9EXwqAo+o4lgveY5bqDYShXQub9s9PqAxa1qD1mRKrU Tzbz65oC36e6RNRAPffEXR5v2eVs1FK2IpnKFsPKUTbJZvuQdBkJ5p98XNaKcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771432015; a=rsa-sha256; cv=none; b=TNVwK/YcRc9AHUchTeptVmo+JSgn0F8mMu/h7kZ1IqhBMjllSZfs70U3FwAelB+oNSRBdb BWaCmjZ9NXtjKsJFWbCk26RMhp5IkBQY77mdlCSpq07Nt6o2M2t/Yj43SONcpDgrHUHBPc pKK2sRiQFSskVWft1Ojayw2Qnc/euNsisPpMt2Ggo/a9E2fY0/EFiSnW0VrgKDzNfhTQ34 djwrxhIiu+JcxKW4oRL9ss0SzJQugt4tzf4pz0uQT0qBNWXrro0R96InP4EAD+oBtcKbzg Eul//qf/LI152mGb2TzRTuySJUp+09SfKAswQPUtuYfxF7nEDmrXCj+slBaOpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771432015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcN2v40dkxilEVidWf/l5Xv1WIg8uVuKYst4atWrRUY=; b=bkOSt8Um/z64RXpxxwDOobt9To3XDIr/342SNwBIlaznfNDS8CZW2h6GG3XWtCfUWOy+p4 idoMNnUNaE7BxIySG9NJ5pEpvDGPbrr6OkzunfjMS1IMWO0RdByZLmkkyXhODBqALPpLCR oOuQYBdi9MMZIqgHn1k6QxyBXQjMo5yfbCVWSmJY30Mm6wRJA90zBuD2Px3XyQjh7pq+qi VMm4XoCagRGMXLGKKKMHIh2U7L+GqyVX6B1YT+KLNXIk61vROjnZKpcch/O94vtJdi1QuB edU8s3IlXBPIeA3TdaTjman73YXDPSq8leqI6AH+jwNUQkWCFbzGGYnuk1v88g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fGMNH3B0Tz13fX for ; Wed, 18 Feb 2026 16:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33613 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Feb 2026 16:26:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: b2ba4131b9b0 - main - intrng: Shuffle unhandled interrupts too List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2ba4131b9b08d6231392c0b798d0ff35809f600 Auto-Submitted: auto-generated Date: Wed, 18 Feb 2026 16:26:55 +0000 Message-Id: <6995e84f.33613.11c3a9c3@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b2ba4131b9b08d6231392c0b798d0ff35809f600 commit b2ba4131b9b08d6231392c0b798d0ff35809f600 Author: Colin Percival AuthorDate: 2026-02-14 00:35:26 +0000 Commit: Colin Percival CommitDate: 2026-02-18 16:26:37 +0000 intrng: Shuffle unhandled interrupts too When interrupt vectors are first allocated, they get assigned to CPU #0; at SI_SUB_SMP / SI_ORDER_SECOND (aka once we have multiple CPUs), the intr_irq_shuffle SYSINIT clears their CPU sets with the effect of forcing them to be assigned to new CPUs later. In case where interrupt vectors were allocated *but not yet bound* this code did not run, with the effect that those interrupts would remain pinned to CPU #0 forever. This affected the ena(4) driver, which allocates interrupts for I/O when the device is attached but doesn't set them up until the interface is brought up much later in the boot process (and, crucially, long after intr_irq_shuffle runs). Adjust intr_irq_shuffle to clear the CPU set for an interrupt source even if it currently has no handlers, so that it will be properly assigned to a CPU when it is used later. Reviewed by: andrew, mhorne MFC after: 1 month Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55284 --- sys/kern/subr_intr.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 3de753a5192f..52170f083624 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -1291,10 +1291,22 @@ intr_irq_shuffle(void *arg __unused) irq_assign_cpu = true; for (i = 0; i < intr_nirq; i++) { isrc = irq_sources[i]; - if (isrc == NULL || isrc->isrc_handlers == 0 || + if (isrc == NULL || isrc->isrc_flags & (INTR_ISRCF_PPI | INTR_ISRCF_IPI)) continue; + /* + * We can reach this point with isrc_handlers == 0 if a + * driver allocates interrupts but does not set them up + * immediately; for example, a network driver might + * postpone calling bus_setup_intr on I/O IRQ(s) until + * the interface is brought up. + */ + if (isrc->isrc_handlers == 0) { + CPU_ZERO(&isrc->isrc_cpu); + continue; + } + if (isrc->isrc_event != NULL && isrc->isrc_flags & INTR_ISRCF_BOUND && isrc->isrc_event->ie_cpu != CPU_FFS(&isrc->isrc_cpu) - 1)