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=1795990552; b=S6ymBTkSjl4U/PqDnT8YUhMMVoDpQpQHiIwnfaOiMWlnaLxZTluxWKpmrKOAwkgJ0ZvT w9366Xg96hAj51qfc9CJST5EMtSl2R7yfrOSFjy2TiUqaRJnJCvdhUVexfXNtRq67/eM+ 0BpU9nmYtCxTySUCUGzAgDFmT9pEEGdqFczndwlM3H+RFngyVHYv2Q29hbFGvVNaUfW2e KkcLMYcM+8A7gvPTzIRSGA6i6ZmLq+vvbPS5rd7w5pJrgWQzz+YdiaLXPdUTwJu/h8dDo bQHs0oUD8C/x30GDcsQI5VLeyWHRSCFVy+kuBiing85Ex8aKxTdA2vmZP6QSC06geVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795990552; 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=nTlxRVu7b4Td1WC/fbzPL7mYbIhA/pCUjr0zIc8euRw=; b=hQT5vvfYNCOA4jiJZOCwJ4lc2T1wEJ/1HBBxBbGUsvgN7Pn8fnfleyIss8hJU1iuTEeK LzIaaB7uzioCbjP8IZ4DvqrLwnAjFeJS2X+K6MWsNBwwo1ugARWU96be1XQoOH8v/JoS3 KjXBx1EEtFEjjZm1DqRVdIYAwM1vp/z6cBiytgtmHIqnU5OhxTW9XMbaXeLuUxEjc3pPy Z77Am24iPUowdhyhq67MIIRPFDtDm2apMJohYd2IiRbY8Kn1qCDn+A+To/06iJ0cQMWD0 tj/jgBxw/M4b+HpltbDsihNAFp3iIR2SKwsOZUekauKThJdmP+00Ez+XGXhjNYviEvw== 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="QTSPIln/"; 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 041AB606A329; Sun, 29 Nov 2026 22:15:51 +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=QTSPIln/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B8391F000C1; Sun, 29 Nov 2026 22:15:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795990551; bh=nTlxRVu7b4Td1WC/fbzPL7mYbIhA/pCUjr0zIc8euRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=QTSPIln/XdhUJ+ZZR5faQqOK79Fz72R8+sIMR1/KNhM0TIS1MSQkqVHg7BMUjEmft 4DmrFwseN7i7hrZ2ttBM7ilH3coR6wMfcS+T8nr624criLTfc4dUIyUa6lUsRCJwFI iL71gcLLue07JtVyf0m6bsPicvaG5DdMSOnuzvkRXmCQlkU48+FupBozvQ/AKSt7TN xBX5q7uMpZkASeq1+/dVUTFFAc13gT2F5UDiGPmF5pRlcWfxd5uC6tEQlqGMzidwOa gRM+M0WP2WKU2Dm1rdGCtOkqqi707WTMZno6FiH6FyeUc8klkpwvqY7myBQoc0o16a BEaj3lxH9jbIw== Date: Sun, 29 Nov 2026 23:15:48 +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-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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261129045436.255364-1-atomlin@atomlin.com> 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! -- Frederic Weisbecker SUSE Labs