From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796031479; b=pI4upicf5N0BweIhzyoLI3w8VoNRWNio2nFDaZfqkGUSEcn3LSqbGGWbILCUgZDtDaBz kTNV0jHKO262pUyF+6qHzpDyNc/OZpdAUouB1x63ZXETduqKTZFkH8/+/vgrWUgrezgA9 n3BIq/Ngr6yjYufF7zWXzr5H4L6J7zk1LITW7bl2tYynenBiUiSTpS8zb7Ff9ilVT6//X /JyLo3juOgGKs1OBi4iIDzg4FRYdzCzMja5CI+AGEf0vUZcrps4Whky330qZV/0gUMJyU w3t1tIFkVQWq/ofY5sh5W6L1uGwvhTR1M6crMTOJSsTEnXvAgTt9hBlfns/lJ/cF5xg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796031479; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=FVsPhMSAfYCJz9gpwQBfCADPWUZoCfv249TDp11Sao0=; b=3FPIhrNhzI9TAhSHsoNPS0ZUkpoes844TwGz6CMHa1PO+X1gUtpQD3pjQdqTgvvcOuev cBptJTmZ5Gj6BRmLcEXz+E8PXVM1Eyw/X/wnCtfAsi/X3PDhKYbXDPv6WJpdlCAKHeUhw EAcx0CILIJVoz6jN2SfFl2aHw7+s6BBEXU1jSzpTVcpR1M/Hlj7vh26pmY9gzXbHT8VJ+ A7VpElNif+Hk3l05ZzaCuPeD7aZd8zuPAKzMkHQ7/OcGOMJkcxTkRHhyZ7eg8N3z10aS0 8tY3gNigib1jaHaHFXbR+lUzAb6B3Rpc+mcDl/FvrKjlz6+pl/Nh4CwVQUlcWXwUFSA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="jM/cm+jb"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E67D8606A31C; Mon, 30 Nov 2026 09:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jM/cm+jb Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDB2D1F00897; Mon, 30 Nov 2026 09:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796031478; bh=FVsPhMSAfYCJz9gpwQBfCADPWUZoCfv249TDp11Sao0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=jM/cm+jb3wB14gEe0PR8mv1/7lwYYZWZZ54sDP4vEYm9GgbNlfQr4HZovULsPM8Tj FAjizJ+bgdjm/xFbYC/jS9E19N1uK5vtbrRyqivMVd09IXS0zS418M33UdJmo+OqMm WNxJS2uKrM/+3bFiDGKAl0CicrprrqVn7kUzIAMXi4cLImBkGHHZmfdMRWrAarUu4i KuJAEzaPaWNjyWjbNGHrHCf6pky537J330ZJ145s969bEMDr/DMXFrXSeKq+tx/du2 0JhtSK4H47+jrZp08rNmtePp4MaolL1GxuCUs7uA7QrGm798l1Fqsod5gcjE2DGfpC oQ8ehBjm4JDHw== Date: Mon, 30 Nov 2026 10:37:55 +0100 From: Frederic Weisbecker To: Aaron Tomlin Cc: axboe@kernel.dk, tglx@kernel.org, aacraid@microsemi.com, James.Bottomley@hansenpartnership.com, mkp@kernel.org, bigeasy@linutronix.de, gmaglione@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, miklos@szeredi.hu, 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: Re: [PATCH v17 00/10] blk: honor isolcpus configuration Message-ID: References: <20261129045436.255364-1-atomlin@atomlin.com> X-Mailing-List: linux-scsi@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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Le Sun, Nov 29, 2026 at 09:52:16PM -0500, Aaron Tomlin a écrit : > On Sun, Nov 29, 2026 at 11:15:48PM +0100, Frederic Weisbecker wrote: > > Le Sat, Nov 28, 2026 at 11:54:24PM -0500, Aaron Tomlin a écrit : > > > Hi Thomas, Jens, Sebastian, Frederic, > > > > > > This is version 17 of the series enabling multiqueue devices and managed > > > interrupts to adhere to CPU isolation constraints. The series has been > > > rebased on v7.4-rc1-3893-g946d9ed1aa02. > > > > > > Background and Problem > > > ====================== > > > > > > Modern multiqueue storage controllers (e.g. NVMe devices) typically > > > allocate one hardware queue and interrupt vector per possible CPU. When > > > CPU isolation is requested via "isolcpus=managed_irq", vector spreading in > > > irq_create_affinity_masks() still distributes vectors across all possible > > > CPUs, relying on irq_do_set_affinity() to strip isolated CPUs afterwards. > > > However, that filtering only works when a vector's affinity mask contains > > > both housekeeping and isolated CPUs. When per-CPU queues are allocated, > > > isolated CPUs receive dedicated vectors whose masks contain no housekeeping > > > CPUs; irq_do_set_affinity() then falls back to the unfiltered mask, leaving > > > completion interrupts for I/O submitted on isolated CPUs targeted directly > > > at those isolated cores. > > > > > > Proposed solution and architecture > > > ================================== > > > > > > Rather than introducing a separate "isolcpus=" sub-parameter as explored in > > > earlier iterations, this series fixes "isolcpus=managed_irq" > > > (HK_TYPE_MANAGED_IRQ) directly in place across the CPU grouping library, > > > generic IRQ affinity allocator, block layer, and virtio-fs: > > > > > > 1. Bounded topological CPU grouping > > > > > > lib/group_cpus introduces group_mask_cpus_evenly(), a bounded > > > counterpart to group_cpus_evenly() that confines NUMA and CPU > > > locality grouping strictly to a caller-supplied cpumask while > > > preserving two-stage (present-first, non-present second) > > > spreading for CPU hotplug safety. > > > > > > 2. Managed and reserved IRQ affinity confinement > > > > > > The genirq/affinity subsystem queries > > > housekeeping_cpumask(HK_TYPE_MANAGED_IRQ) directly and passes > > > it to group_mask_cpus_evenly(), restricting managed interrupt > > > vector calculation and distribution exclusively to housekeeping > > > CPUs. Unmanaged pre and post vectors (e.g. NVMe admin or device > > > configuration queues) are also confined to housekeeping CPUs by > > > default via irq_set_reserved_mask(), while remaining unmanaged > > > so user space can adjust their affinity after probe. > > > > > > 3. Block layer and virtio-fs queue mapping > > > > > > Both blk-mq and virtio-fs bound their queue counts to the > > > HK_TYPE_MANAGED_IRQ housekeeping CPU mask and map housekeeping > > > CPUs to hardware/request queues first. Any remaining possible > > > CPUs (including isolated CPUs) are then distributed evenly > > > across the active housekeeping-backed queues, allowing tasks on > > > isolated CPUs to submit I/O while completion interrupts fire > > > exclusively on housekeeping cores. > > > > > > 4. CPU hotplug protection > > > > > > To prevent I/O stalls, the block layer rejects hotplug requests > > > that attempt to offline the last online housekeeping CPU > > > serving a hardware context (hctx) while any isolated CPU mapped > > > to that hctx remains online (with system suspend and > > > hibernation exempted via cpuhp_tasks_frozen). > > > > > > Please let me know your thoughts. > > > > I don't get all the details but I like the idea. Also I like that > > this is enhancing managed_irq instead of introducing yet another flag. > > > > Acked-by: Frederic Weisbecker > > > > Thanks! > > Hi Frederic, > > Thank you. > > Please note that the next iteration will include a few localised > corner-case fixes in blk-mq and genirq (i.e. patches 5, 6, 8, and 10) > caught by Sashiko AI review, with no changes to the overall > isolcpus=managed_irq design. Ok, feel free to keep my ack then. Thanks, and sorry to react so late on that patchset... > > Kind regards, > -- > Aaron Tomlin -- Frederic Weisbecker SUSE Labs