The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Aaron Tomlin <atomlin@atomlin.com>
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	[thread overview]
Message-ID: <20261129072612.257915-4-atomlin@atomlin.com> (raw)
In-Reply-To: <20261129045436.255364-1-atomlin@atomlin.com>

From: Daniel Wagner <wagi@kernel.org>

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 <wagi@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Co-developed-by: Aaron Tomlin <atomlin@atomlin.com>
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
---
 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/admin-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=" kernel boot parameter for a default setting.
 
 - The "managed_irq" flag in the "isolcpus=" kernel boot parameter
-  tries a best effort affinity override for managed IRQs.
+  restricts multiqueue hardware queue allocation and managed IRQ
+  affinity to housekeeping CPUs.
 
 Full Dynticks (aka nohz_full)
 -----------------------------
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/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
 			  "number of CPUs in system - 1".
 
 			managed_irq
-
-			  Isolate from being targeted by managed interrupts
-			  which have an interrupt mask containing isolated
-			  CPUs. The affinity of managed interrupts is
-			  handled by the kernel and cannot be changed via
-			  the /proc/irq/* interfaces.
-
-			  This isolation is best effort and only effective
-			  if the automatically assigned interrupt mask of a
-			  device queue contains isolated and housekeeping
-			  CPUs. If housekeeping CPUs are online then such
-			  interrupts are directed to the housekeeping CPU
-			  so that IO submitted on the housekeeping CPU
-			  cannot disturb the isolated CPU.
-
-			  If a queue's affinity mask contains only isolated
-			  CPUs then this parameter has no effect on the
-			  interrupt routing decision, though interrupts are
-			  only delivered when tasks running on those
-			  isolated CPUs submit IO. IO submitted on
-			  housekeeping CPUs has no influence on those
-			  queues.
+			  Strictly restrict multiqueue hardware queue
+			  allocation and managed interrupt affinity to
+			  housekeeping CPUs. The affinity of managed
+			  interrupts is handled by the kernel and cannot
+			  be changed via the /proc/irq/* interfaces.
+			  Managed interrupts and multiqueue block device
+			  queues are never created for or mapped to
+			  isolated CPUs.
+
+			  In the block layer (blk-mq), device queue allocation
+			  and CPU-to-queue mappings are restricted to
+			  housekeeping CPUs. For devices using managed
+			  interrupts, hardware completion interrupts are routed
+			  exclusively to housekeeping cores, shielding isolated
+			  CPUs from I/O interruptions even if they initiated the
+			  request.
+
+			  Note: Using managed_irq restricts the number of
+			  allocated hardware queues to match the number of
+			  housekeeping CPUs for single-set drivers. This
+			  prevents MSI-X vector exhaustion and forces isolated
+			  CPUs to share submission queues.
+
+			  Note: Offlining housekeeping CPUs which serve
+			  isolated CPUs will fail. The isolated CPUs must
+			  be offlined before offlining the housekeeping
+			  CPUs.
+
+			  Note: When I/O is submitted by an application on
+			  an isolated CPU, the hardware completion
+			  interrupt is handled entirely by a housekeeping
+			  CPU.
 
 			The format of <cpu-list> is described above.
 
diff --git a/Documentation/core-api/housekeeping.rst b/Documentation/core-api/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``:
 	parameters. This includes remote scheduler tick, vmstat and lockup
 	watchdog.
 
-3.	HK_TYPE_MANAGED_IRQ matches the IRQ handlers moved away by managed
-	IRQ isolation performed through ``isolcpus=managed_irq``.
+3.	HK_TYPE_MANAGED_IRQ matches the multiqueue block devices and
+	managed IRQs strictly restricted to housekeeping CPUs through
+	``isolcpus=managed_irq``.
 
 4.	HK_TYPE_DOMAIN_BOOT matches the work moved away by scheduler domain
 	isolation performed through ``isolcpus=domain`` only. It is similar
diff --git a/Documentation/core-api/irq/managed_irq.rst b/Documentation/core-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
 
 The affinity of managed interrupts is handled entirely in the kernel and cannot
 be modified from user space through the /proc interfaces. The managed_irq
-sub‑parameter of the isolcpus boot option specifies a CPU mask that managed
-interrupts should attempt to avoid. This isolation is best‑effort and only
-applies if the automatically assigned interrupt mask also contains online CPUs
-outside the avoided mask. If the requested mask contains only isolated CPUs,
-the setting has no effect.
+sub-parameter of the isolcpus boot option restricts multiqueue block device
+queue allocation and managed interrupt affinity strictly to housekeeping CPUs
+(the CPUs outside the specified isolated mask).
 
-CPUs listed in the avoided mask remain part of the interrupt’s affinity mask.
-This means that if all non‑isolated 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 masks
+and vector limits. In the block layer (blk-mq), isolated CPUs share hardware
+queues owned by housekeeping CPUs so that completion interrupts never target
+isolated cores, and offlining the last housekeeping CPU serving an active
+isolated CPU is rejected.
 
 The following examples assume a system with 8 CPUs.
 
 - A QEMU instance is booted with "-device virtio-scsi-pci".
-  The MSI‑X device exposes 11 interrupts: 3 "management" interrupts 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.
 
+- If the same "-device virtio-scsi-pci" instance is booted with
+  "isolcpus=managed_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 two
+  submission queues.
+
 - A QEMU instance is booted with "-device virtio-scsi-pci,num_queues=2"
   and the kernel command line includes:
   "irqaffinity=0,1 isolcpus=domain,2-7 isolcpus=managed_irq,1-3,5-7".
-  The MSI‑X device exposes 5 interrupts: 3 management interrupts and 2 queue
+  The MSI-X device exposes 5 interrupts: 3 management interrupts and 2 queue
   interrupts. The management interrupts follow the irqaffinity= setting. The
-  queue interrupts are spread across available CPUs::
+  queue interrupts are spread strictly across the housekeeping CPUs (0 and 4)::
 
     /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–7 when possible.
+    /proc/irq/48/smp_affinity_list:4
 
   Replacing the managed_irq argument with "isolcpus=managed_irq,1-3,4-5,7"
-  results in::
+  leaves CPUs 0 and 6 as housekeeping CPUs, resulting in::
 
     /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 and
-  7. If CPU6 is taken offline, the interrupt migrates to one of the "isolated"
-  CPUs::
-
-    /proc/irq/48/effective_affinity_list:7
-    /proc/irq/48/smp_affinity_list:4-7
+    /proc/irq/48/smp_affinity_list:6
 
-  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 online,
+  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.
-- 
2.55.0


  parent reply	other threads:[~2026-11-29  7:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  4:54 [PATCH v17 00/10] blk: honor isolcpus configuration Aaron Tomlin
2026-11-29  4:54 ` [PATCH v17 01/10] scsi: aacraid: use block layer helpers to calculate num of queues Aaron Tomlin
2026-11-29  4:54 ` [PATCH v17 02/10] lib/group_cpus: remove dead !SMP code Aaron Tomlin
2026-11-29  4:54 ` [PATCH v17 03/10] lib/group_cpus: Add group_mask_cpus_evenly() Aaron Tomlin
2026-11-29  4:54 ` [PATCH v17 04/10] sched/isolation: Prevent out-of-bounds read in isolcpus= boot parameter parser Aaron Tomlin
2026-11-29  4:54 ` [PATCH v17 05/10] blk-mq: use hk cpus only when isolcpus=managed_irq is enabled Aaron Tomlin
2026-11-29  7:26 ` [PATCH v17 06/10] blk-mq: prevent offlining hk CPUs with associated online isolated CPUs Aaron Tomlin
2026-11-29  7:26 ` [PATCH v17 07/10] virtio-fs: honour isolcpus=managed_irq in queue mapping Aaron Tomlin
2026-11-29  7:26 ` [PATCH v17 08/10] genirq/affinity: Restrict managed IRQ affinity to housekeeping CPUs Aaron Tomlin
2026-11-29  7:26 ` Aaron Tomlin [this message]
2026-11-29  7:26 ` [PATCH v17 10/10] genirq/affinity: Confine pre and post vectors " Aaron Tomlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129072612.257915-4-atomlin@atomlin.com \
    --to=atomlin@atomlin.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=aacraid@microsemi.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bigeasy@linutronix.de \
    --cc=chjohnst@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dwagner@suse.de \
    --cc=eperezma@redhat.com \
    --cc=frederic@kernel.org \
    --cc=fuse-devel@lists.linux.dev \
    --cc=gmaglione@redhat.com \
    --cc=ionut.nechita@windriver.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=marco.crivellari@suse.com \
    --cc=miklos@szeredi.hu \
    --cc=mingo@redhat.com \
    --cc=mkp@kernel.org \
    --cc=mproche@gmail.com \
    --cc=neelx@suse.com \
    --cc=nick.lange@gmail.com \
    --cc=peterz@infradead.org \
    --cc=radu@rendec.net \
    --cc=rishil1999@outlook.com \
    --cc=sean@ashe.io \
    --cc=stefanha@redhat.com \
    --cc=steve@abita.co \
    --cc=tglx@kernel.org \
    --cc=tom.leiming@gmail.com \
    --cc=vgoyal@redhat.com \
    --cc=vincent.guittot@linaro.org \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox