From nobody Wed Mar 18 19:10:28 2026 X-Original-To: dev-commits-src-branches@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 4fbdh45rX3z6WBwV for ; Wed, 18 Mar 2026 19:10:28 +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 4fbdh45DgBz3Kkr for ; Wed, 18 Mar 2026 19:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773861028; 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=eLs52T2FFCurq+QKx51iTJ6SaNmK9z3r6GF7Fa37w1A=; b=NsITTUBxNfwJCa6Vx5xCa0Pd133YQotpWGR3T0+YiW77UJ0ZTX0t/iR5uybk+Y7p8D1pj6 rwZTGlgg0pDBiASmOZiaVxsdd/u60X/hMnK2n2Ej1gncVh7juOOOlfNQViLW0acC7mo8+U mbCJewEVkFtz55468pVVdO93qFKqZ+ITzCiwJBFyiOmavPpmcAgT50Cv5Dp2Yvg9fNhFYK NVPlqdaAmiykXhcQotX6eb6KvlCdsQYpQfnlzVcGoxOp6xCsOLw68k3mP7rsXeatyb44Nd CSimAIvhMePmtAZjvLRMjr15M+6wO2fNjzRpb3SI6Gba8KqReTtwA/Ut/vJB/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1773861028; a=rsa-sha256; cv=none; b=qFDCuwiqzeZWoUi5cwfIllgKaR/0lGGPv5Da9MKbHMhsLWNKkb5V+PSeFXCDah8TtudHO2 DuKiT8IRSr664Y8v4cY9vu1FgF0WRSOZSlwCyjd58ApqtAXkblGSdyHnX5dCmYxme/6uFN uRaqDYp/2PYyTlINW52X2qw+EjzPM94+3e3DHwrWdQTQD1R9TCbZmvVjRqqU9WE8B5UrVv BkkS80ozw0ep4EGvQjdGP+TKJbwBHSfCAGxRA2NOcEOO26P4npawM/bJNZQFgHxN14nzzL ouTdvBZ0Fub78QtSanNc0tnVl9gKIRKGT7OfvvY61U+LrLciEf+RZls9E8wKGg== 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=1773861028; 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=eLs52T2FFCurq+QKx51iTJ6SaNmK9z3r6GF7Fa37w1A=; b=XvlWhiGB+v2RkDITA+BlgPvPDP8nV6ffPFdsuLGkXCBW/u0+pEtsvLjbrRdymuxr3T+DVC kKsa6tp8k+ts6zM1Hmy6RXgB1sFLnu4n6Pq3hnciJ9L9w8dQwcQpicoAVMJtXN0L2Z79/0 oW5MHdCNXEnVFgXzXeL4aM/G1lUip1IflvGq+wWMu+k+w3vCalx4cg/o6jZnavGg1ajzUF y0n9thZI+Vy87DegIp7/mpU3h6zVhpLcwOyyoZ2UQfuu+frftk+lCV454WKVDCu6tLPq0p tNERq4UDUHVFaKdwyUTn4HhtQ1Oannjuz8EadHIJwKy/WDS69jxfiQTMYshFJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fbdh44Vlrz680 for ; Wed, 18 Mar 2026 19:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38237 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Mar 2026 19:10:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: b1098090b7cf - stable/15 - intrng: Shuffle unhandled interrupts too List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/15 X-Git-Reftype: branch X-Git-Commit: b1098090b7cff96f92f56456324e176b9b4a60a9 Auto-Submitted: auto-generated Date: Wed, 18 Mar 2026 19:10:28 +0000 Message-Id: <69baf8a4.38237.7803b4e5@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b1098090b7cff96f92f56456324e176b9b4a60a9 commit b1098090b7cff96f92f56456324e176b9b4a60a9 Author: Colin Percival AuthorDate: 2026-02-14 00:35:26 +0000 Commit: Colin Percival CommitDate: 2026-03-18 19:05:16 +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 (cherry picked from commit b2ba4131b9b08d6231392c0b798d0ff35809f600) --- 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)