Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=34.202.193.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795937259; b=MYoCn7sZEZUY3J6sZjWbGCSF9Wum6iPhkaUMoRb/gz5U5jhHrY4andTr1W14J+gtidxo gvhTHOuQwo36FdvutpddrE3XUAZ8/jzviwFVlsYBDoeuDWbjRIBUfjNLfKLDq4cUNK3l0 Rvsd6Mlu8sCdGCPqP3ECrDw3QOWJ2+ro3c0SbfaCHCAZy1ghdxmdCfpmzDdj+71+862Gp KLcwIt6dIICbU59EUYFhjv667Ptn1vA5MDL15DZ6p/6G8dEURcTc5YnWk1MtHSD6HWlJD BbHYOYaR194IquqTJCtrSVcHf1my+2WANvg/ihSFRf0pbEOOuPg8yPazW51t5KQOwvQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795937259; h=DMARC-Filter:DKIM-Signature:DKIM-Signature:Feedback-ID: X-Pm-Original-To:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:X-MIME-Autoconverted; bh=R23oJmxfxen6IYpZzkX6Q1qUTmVlD/xKEUDF6lUMjwA=; b=yXhnspNXlQrswpudpSZt76a0KBIR6ndkQz8XmGf/AhsxmRTAarjN50C8f41T7d7CsVR1 UjLsmnpK4fLVDczyRQkSSzoWUwTzD7XKXxnvcSyx4eyufEn1vJbjmkkD2yPlsWIPoD9G5 aJM0H+tCNzGHRRmXeGeROifXAj1mVEqicApt/jrOm+Hv8iP4GEzeRfhGxy8cYrbF+YFvU PvgES/zVpPnzBph0SPRHlY0W405vzqd2Q72hX/lbLBlHtHoqeZYQDx9hjEub3ZPkXE311 0FbnLWMXcQPn5o9ObQsgQYJRwwSTwvWpxF5peEnt+DlIcpy16tTV3Fb7/st3iNIy5Iw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; dkim=pass header.d=atomlin.com header.i=@atomlin.com header.a=rsa-sha256 header.s=purelymail3 header.b=fuzopOhA; dkim=pass header.d=purelymail.com header.i=@purelymail.com header.a=rsa-sha256 header.s=purelymail3 header.b=YMF9SM2+; arc=none smtp.remote-ip=34.202.193.197 Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E17B606A330 for ; Sun, 29 Nov 2026 07:27:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0E17B606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=atomlin.com header.i=@atomlin.com header.a=rsa-sha256 header.s=purelymail3 header.b=fuzopOhA; dkim=pass (2048-bit key, unprotected) header.d=purelymail.com header.i=@purelymail.com header.a=rsa-sha256 header.s=purelymail3 header.b=YMF9SM2+ DKIM-Signature: a=rsa-sha256; b=fuzopOhATv8uD9pC5jh/t+rt4yuqV+rn9IgoOpTZegh9b5PZsp78hOG5s0QFp4RA1f0hrXZxV3g1hMJ0DkMMWm7EMQRz1YI93Mpli0uwYQ/kmIZG8GZI2QoQK1+XoMk5E81ucu20uQLTUf46FxQV0i/bskIgxVJvKP7rd0UyI4IhbceKNakckWIRMP2Mu9KxyAURj19TIiOAtH+zLAsApY0nQJIc5k/cxPRsS2b2d7bCa+7S53SPTaST5VY/NxMHSNpMH1EmlJeZoJ+NWSssABvdAQFt697g9d/bG23+28ERt7kKZSmbmMOnKbOy/V2dSdH08GIgM96ABOb/iI1MMA==; s=purelymail3; d=atomlin.com; v=1; bh=uG9a5qfPHo1ClDXLqFXpx8MT04kEjP0h5EqLCIYac5k=; h=Received:From:To:Subject:Date:Message-ID; DKIM-Signature: a=rsa-sha256; b=YMF9SM2+NLmWoN4tUe86WqCwzvrJKTynX6DKXc7raHCdQ9NT+2lV1D/6kwJc8v6hiRPnWkHiwm5oZ3L0Lv5eTwmP84DPNoppYzwj1+qGUvzJa5xYKCiorNofBlfvDezXsZxCqkzbTi4sfkgxbuHQ5xyD9kiOhC/lmzmxamuM98K4gHXuDrdKAdL/pVw8nIENXGWghx8KDXy1Pj6kGURwYjlH1DSUKHq/Ipkks9UB3xBiHfK8rJ5GnHRz2T2APd60ByGpI6kVoVjdXmrxHbH/Vlo3GeKRT4sSE8vBjTsmAHnI0R+4voPIO/zF5RysVhAg1rxqto8lRCKxzIEUDn+FKg==; s=purelymail3; d=purelymail.com; v=1; bh=uG9a5qfPHo1ClDXLqFXpx8MT04kEjP0h5EqLCIYac5k=; h=Feedback-ID:Received:From:To:Subject:Date:Message-ID; Feedback-ID: 1802931:67223:null:purelymail X-Pm-Original-To: linux-doc@vger.kernel.org Authentication-Results: purelymail.com; auth=pass Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1520508824; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 29 Nov 2026 07:26:15 +0000 (UTC) From: Aaron Tomlin To: axboe@kernel.dk, tglx@kernel.org, aacraid@microsemi.com, James.Bottomley@HansenPartnership.com, mkp@kernel.org, frederic@kernel.org, bigeasy@linutronix.de, gmaglione@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, miklos@szeredi.hu Cc: atomlin@atomlin.com, dwagner@suse.de, eperezma@redhat.com, tom.leiming@gmail.com, ionut.nechita@windriver.com, corbet@lwn.net, vincent.guittot@linaro.org, mingo@redhat.com, peterz@infradead.org, radu@rendec.net, akpm@linux-foundation.org, steve@abita.co, sean@ashe.io, chjohnst@gmail.com, neelx@suse.com, mproche@gmail.com, nick.lange@gmail.com, marco.crivellari@suse.com, rishil1999@outlook.com, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, virtualization@lists.linux.dev, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v17 09/10] docs: update isolcpus=managed_irq documentation Date: Sun, 29 Nov 2026 02:26:09 -0500 Message-ID: <20261129072612.257915-4-atomlin@atomlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261129045436.255364-1-atomlin@atomlin.com> References: <20261129045436.255364-1-atomlin@atomlin.com> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail From: Daniel Wagner The managed_irq flag now strictly restricts multiqueue hardware queue allocation and managed interrupt affinity to housekeeping CPUs rather than relying on best-effort post-allocation steering. Update its description across the kernel command-line parameters, core housekeeping guide, managed interrupt guide, and CPU isolation documentation accordingly. Signed-off-by: Daniel Wagner Reviewed-by: Hannes Reinecke Co-developed-by: Aaron Tomlin Signed-off-by: Aaron Tomlin --- Documentation/admin-guide/cpu-isolation.rst | 3 +- .../admin-guide/kernel-parameters.txt | 54 +++++++++++-------- Documentation/core-api/housekeeping.rst | 5 +- Documentation/core-api/irq/managed_irq.rst | 52 +++++++++--------- 4 files changed, 62 insertions(+), 52 deletions(-) diff --git a/Documentation/admin-guide/cpu-isolation.rst b/Documentation/ad= min-guide/cpu-isolation.rst index b9f13a928673..76762f5f7678 100644 --- a/Documentation/admin-guide/cpu-isolation.rst +++ b/Documentation/admin-guide/cpu-isolation.rst @@ -131,7 +131,8 @@ Interfaces - The "irqaffinity=3D" kernel boot parameter for a default setting. =20 - The "managed_irq" flag in the "isolcpus=3D" kernel boot parameter - tries a best effort affinity override for managed IRQs. + restricts multiqueue hardware queue allocation and managed IRQ + affinity to housekeeping CPUs. =20 Full Dynticks (aka nohz_full) ----------------------------- diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index dce9b8f3ae98..c5bf9db3d8aa 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2815,28 +2815,38 @@ Kernel parameters =09=09=09 "number of CPUs in system - 1". =20 =09=09=09managed_irq - -=09=09=09 Isolate from being targeted by managed interrupts -=09=09=09 which have an interrupt mask containing isolated -=09=09=09 CPUs. The affinity of managed interrupts is -=09=09=09 handled by the kernel and cannot be changed via -=09=09=09 the /proc/irq/* interfaces. - -=09=09=09 This isolation is best effort and only effective -=09=09=09 if the automatically assigned interrupt mask of a -=09=09=09 device queue contains isolated and housekeeping -=09=09=09 CPUs. If housekeeping CPUs are online then such -=09=09=09 interrupts are directed to the housekeeping CPU -=09=09=09 so that IO submitted on the housekeeping CPU -=09=09=09 cannot disturb the isolated CPU. - -=09=09=09 If a queue's affinity mask contains only isolated -=09=09=09 CPUs then this parameter has no effect on the -=09=09=09 interrupt routing decision, though interrupts are -=09=09=09 only delivered when tasks running on those -=09=09=09 isolated CPUs submit IO. IO submitted on -=09=09=09 housekeeping CPUs has no influence on those -=09=09=09 queues. +=09=09=09 Strictly restrict multiqueue hardware queue +=09=09=09 allocation and managed interrupt affinity to +=09=09=09 housekeeping CPUs. The affinity of managed +=09=09=09 interrupts is handled by the kernel and cannot +=09=09=09 be changed via the /proc/irq/* interfaces. +=09=09=09 Managed interrupts and multiqueue block device +=09=09=09 queues are never created for or mapped to +=09=09=09 isolated CPUs. + +=09=09=09 In the block layer (blk-mq), device queue allocation +=09=09=09 and CPU-to-queue mappings are restricted to +=09=09=09 housekeeping CPUs. For devices using managed +=09=09=09 interrupts, hardware completion interrupts are routed +=09=09=09 exclusively to housekeeping cores, shielding isolated +=09=09=09 CPUs from I/O interruptions even if they initiated the +=09=09=09 request. + +=09=09=09 Note: Using managed_irq restricts the number of +=09=09=09 allocated hardware queues to match the number of +=09=09=09 housekeeping CPUs for single-set drivers. This +=09=09=09 prevents MSI-X vector exhaustion and forces isolated +=09=09=09 CPUs to share submission queues. + +=09=09=09 Note: Offlining housekeeping CPUs which serve +=09=09=09 isolated CPUs will fail. The isolated CPUs must +=09=09=09 be offlined before offlining the housekeeping +=09=09=09 CPUs. + +=09=09=09 Note: When I/O is submitted by an application on +=09=09=09 an isolated CPU, the hardware completion +=09=09=09 interrupt is handled entirely by a housekeeping +=09=09=09 CPU. =20 =09=09=09The format of is described above. =20 diff --git a/Documentation/core-api/housekeeping.rst b/Documentation/core-a= pi/housekeeping.rst index 71ba5d86f249..b148d8d38d52 100644 --- a/Documentation/core-api/housekeeping.rst +++ b/Documentation/core-api/housekeeping.rst @@ -36,8 +36,9 @@ by the ``enum hk_type type``: =09parameters. This includes remote scheduler tick, vmstat and lockup =09watchdog. =20 -3.=09HK_TYPE_MANAGED_IRQ matches the IRQ handlers moved away by managed -=09IRQ isolation performed through ``isolcpus=3Dmanaged_irq``. +3.=09HK_TYPE_MANAGED_IRQ matches the multiqueue block devices and +=09managed IRQs strictly restricted to housekeeping CPUs through +=09``isolcpus=3Dmanaged_irq``. =20 4.=09HK_TYPE_DOMAIN_BOOT matches the work moved away by scheduler domain =09isolation performed through ``isolcpus=3Ddomain`` only. It is similar diff --git a/Documentation/core-api/irq/managed_irq.rst b/Documentation/cor= e-api/irq/managed_irq.rst index 05e295f3c289..850f4a7f9762 100644 --- a/Documentation/core-api/irq/managed_irq.rst +++ b/Documentation/core-api/irq/managed_irq.rst @@ -51,20 +51,20 @@ Isolated CPUs =20 The affinity of managed interrupts is handled entirely in the kernel and c= annot be modified from user space through the /proc interfaces. The managed_irq -sub=E2=80=91parameter of the isolcpus boot option specifies a CPU mask tha= t managed -interrupts should attempt to avoid. This isolation is best=E2=80=91effort = and only -applies if the automatically assigned interrupt mask also contains online = CPUs -outside the avoided mask. If the requested mask contains only isolated CPU= s, -the setting has no effect. +sub-parameter of the isolcpus boot option restricts multiqueue block devic= e +queue allocation and managed interrupt affinity strictly to housekeeping C= PUs +(the CPUs outside the specified isolated mask). =20 -CPUs listed in the avoided mask remain part of the interrupt=E2=80=99s aff= inity mask. -This means that if all non=E2=80=91isolated CPUs go offline while isolated= CPUs remain -online, the interrupt will be assigned to one of the isolated CPUs. +Isolated CPUs are excluded when computing the managed interrupt affinity m= asks +and vector limits. In the block layer (blk-mq), isolated CPUs share hardwa= re +queues owned by housekeeping CPUs so that completion interrupts never targ= et +isolated cores, and offlining the last housekeeping CPU serving an active +isolated CPU is rejected. =20 The following examples assume a system with 8 CPUs. =20 - A QEMU instance is booted with "-device virtio-scsi-pci". - The MSI=E2=80=91X device exposes 11 interrupts: 3 "management" interrupt= s and 8 + The MSI-X device exposes 11 interrupts: 3 "management" interrupts and 8 "queue" interrupts. The driver requests the 8 queue interrupts, each of = which is affine to exactly one CPU. If that CPU goes offline, the interrupt is= shut down. @@ -84,33 +84,31 @@ The following examples assume a system with 8 CPUs. (/sys/kernel/debug/irq/irqs/48). The dstate field will include IRQD_IRQ_DISABLED, IRQD_IRQ_MASKED and IRQD_MANAGED_SHUTDOWN. =20 +- If the same "-device virtio-scsi-pci" instance is booted with + "isolcpus=3Dmanaged_irq,2-7", queue and vector allocation is restricted = to the + two housekeeping CPUs (0 and 1). Only 2 queue interrupts are allocated, + affine strictly to CPU0 and CPU1, while isolated CPUs 2-7 share those tw= o + submission queues. + - A QEMU instance is booted with "-device virtio-scsi-pci,num_queues=3D2" and the kernel command line includes: "irqaffinity=3D0,1 isolcpus=3Ddomain,2-7 isolcpus=3Dmanaged_irq,1-3,5-7"= . - The MSI=E2=80=91X device exposes 5 interrupts: 3 management interrupts a= nd 2 queue + The MSI-X device exposes 5 interrupts: 3 management interrupts and 2 que= ue interrupts. The management interrupts follow the irqaffinity=3D setting.= The - queue interrupts are spread across available CPUs:: + queue interrupts are spread strictly across the housekeeping CPUs (0 and= 4):: =20 /proc/irq/47/effective_affinity_list:0 - /proc/irq/47/smp_affinity_list:0-3 + /proc/irq/47/smp_affinity_list:0 /proc/irq/48/effective_affinity_list:4 - /proc/irq/48/smp_affinity_list:4-7 - - The two queue interrupts are evenly distributed. Interrupt 48 is placed = on CPU4 - because the managed_irq mask avoids CPUs 5=E2=80=937 when possible. + /proc/irq/48/smp_affinity_list:4 =20 Replacing the managed_irq argument with "isolcpus=3Dmanaged_irq,1-3,4-5,= 7" - results in:: + leaves CPUs 0 and 6 as housekeeping CPUs, resulting in:: =20 /proc/irq/48/effective_affinity_list:6 - /proc/irq/48/smp_affinity_list:4-7 - - Interrupt 48 is now served on CPU6 because the system avoids CPUs 4, 5 a= nd - 7. If CPU6 is taken offline, the interrupt migrates to one of the "isola= ted" - CPUs:: - - /proc/irq/48/effective_affinity_list:7 - /proc/irq/48/smp_affinity_list:4-7 + /proc/irq/48/smp_affinity_list:6 =20 - The interrupt is shut down once all CPUs listed in its smp_affinity mask= are - offline. + While any isolated CPU mapped to CPU6's block hardware queue remains onl= ine, + attempting to take CPU6 offline fails with -EINVAL. Once those dependent + isolated CPUs are taken offline first, taking CPU6 offline shuts the + interrupt down rather than migrating it onto an isolated CPU. --=20 2.55.0