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=1795938083; b=Mo/Mxm5osXTwFcO7dIzjTya+++vunnYWC+3ulWDK3PWpjLedD+VrcTEu7jAYwO1YoPXT /+UxYKH7+jbfVJlnnJgIc4BFqbSbUrVTtdrrNn9NTiGUxG84CzIBMpWrtaX89FfmnQ2xK TN9roCz5DlLnC4F5uybcl0HZFRJYRNw0zmymmO7j9c0UFaee51y2ptmcQpOpU9F+EHoNO ObLGPkYri1L59esIgCCvlKS/iluckxz5uH+sxHe+qcSUboFqvmNdwhor8b5yQXmS7/4zg RYCxcVfROM0Bs5yrx8h4aA6InTmG9pDr5k+5c+Unuj87kTk6obETfIHE6vHNDmNbHjg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795938083; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=wWo2/OsNgXStVq5FcpUDe+yUQsQ8EPQ2QrkisuJcDlA=; b=VvEO5DGtEWzf6fuEfaLC8QB1TtxEfgIUjcIYoCsuahWoE9+saX7lggBx+FJ1OqR2MFOO XkSp+rtOkz/PAW1SR++FVZzI7/zdzbC4KFrbM1NbK04xsqXHsbYUYeIJkttxvw8zIjA/I fwPRuunaVxbI5IGj/0rosUXB+5UWHEew26ODhpF3GqnHPCglAiEpSQP4APjZAlR9obXS1 4RyhAwPA5Utujdeyb9aM75ZUeGR3MWYWC807MkGa2YJoYiVNk2TAAFQx475+is44lSa/F fZx7DqbtDKnEeQLM6t6zsvb7VciChfp3Jpq4du5sVgOZ9goMv58eFYHJ8rAl/30R6nA== 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=HOhKw4pX; 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 194DD606A31C; Sun, 29 Nov 2026 07:41:22 +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=HOhKw4pX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 309181F0089F; Sun, 29 Nov 2026 07:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795938082; bh=wWo2/OsNgXStVq5FcpUDe+yUQsQ8EPQ2QrkisuJcDlA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=HOhKw4pX9WkckKBaaZQGcvkfiyG/IkzmYHLaUZm+wqpCIxJjupTiOVAiOnOsuqvOo giiIRKih84DiE+EPGvCR7Go/cRYVjFqo9cri6kMCKeNF2ldkk196Wtzxhh5y7StiFO lPUwN4kgZnfqkNavU3/li8hw2f3GLg1hojb+y83ayf3WKdDQm5DqtELh2zdNxkKDjQ AMBuKbzftp+x7xwN1/9JVnzqE/9ebMqVCRERGHKzLUJMVU4WHJdbFsBzGmJ0e5nnxQ Q1Z4ZrwJGKdYsfmCnN3rBhg9U2wSDhqCoR/KMeQlPxxiem79AtLmQ4CxMhAG6Pt7hX 7+ADR08ATzsXQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v17 10/10] genirq/affinity: Confine pre and post vectors to housekeeping CPUs Reply-To: sashiko-reviews@lists.linux.dev To: "Aaron Tomlin" Cc: linux-scsi@vger.kernel.org, virtualization@lists.linux.dev, "Michael S. Tsirkin" , "Eugenio Perez" In-Reply-To: <20261129072612.257915-5-atomlin@atomlin.com> References: <20261129045436.255364-1-atomlin@atomlin.com> <20261129072612.257915-5-atomlin@atomlin.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 07:41:21 +0000 X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] genirq/affinity: pre/post vector masks lost in irq_update_affinity_desc() -- commit e45cd1796d752098cee854c7f5d5fc65f6221300 Author: Ionut Nechita genirq/affinity: Confine pre and post vectors to housekeeping CPUs When HK_TYPE_MANAGED_IRQ is enabled, this commit confines unmanaged pre_vectors and post_vectors in irq_create_affinity_masks() to the housekeeping cpumask (intersected with irq_default_affinity) instead of copying irq_default_affinity directly. > diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c > index a4bbcaafbe366..e1d64657a3c3d 100644 > --- a/kernel/irq/affinity.c > +++ b/kernel/irq/affinity.c > @@ -16,6 +16,30 @@ static void default_calc_sets(struct irq_affinity *aff= d, unsigned int affvecs) > affd->set_size[0] =3D affvecs; > } > =20 > +/** > + * irq_set_reserved_mask - Populate affinity mask for reserved pre/post = vectors > + * @dst: Destination cpumask to populate > + * @hk_mask: Housekeeping cpumask for HK_TYPE_MANAGED_IRQ > + * @hk_enabled: True when HK_TYPE_MANAGED_IRQ isolation is active > + * > + * Confine unmanaged pre/post vectors (e.g. the NVMe admin queue) to > + * housekeeping CPUs while still honouring irq_default_affinity when the > + * intersection contains at least one online CPU. > + */ > +static void irq_set_reserved_mask(struct cpumask *dst, > + const struct cpumask *hk_mask, > + bool hk_enabled) > +{ > + if (!hk_enabled) { > + cpumask_copy(dst, irq_default_affinity); > + return; > + } > + > + if (!cpumask_and(dst, irq_default_affinity, hk_mask) || > + !cpumask_intersects(dst, cpu_online_mask)) > + cpumask_copy(dst, hk_mask); > +} > + > /** > * irq_create_affinity_masks - Create affinity masks for multiqueue spre= ading > * @nvecs: The total number of vectors > @@ -65,7 +89,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct ir= q_affinity *affd) > =20 > /* Fill out vectors at the beginning that don't need affinity */ > for (curvec =3D 0; curvec < affd->pre_vectors; curvec++) > - cpumask_copy(&masks[curvec].mask, irq_default_affinity); > + irq_set_reserved_mask(&masks[curvec].mask, hk_mask, hk_enabled); > =20 > /* > * Spread on present CPUs starting from affd->pre_vectors. If we > @@ -104,7 +128,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct = irq_affinity *affd) > else > curvec =3D affd->pre_vectors + usedvecs; > for (; curvec < nvecs; curvec++) > - cpumask_copy(&masks[curvec].mask, irq_default_affinity); > + irq_set_reserved_mask(&masks[curvec].mask, hk_mask, hk_enabled); [Severity: Medium] Are the housekeeping-confined masks for pre_vectors and post_vectors discarded on the platform IRQ path? Unlike alloc_descs(), which sets IRQD_AFFINITY_SET on every descriptor initialized from a struct irq_affinity_desc, devm_platform_get_irqs_affinity() applies the masks via irq_update_affinity_desc(), which does not set IRQD_AFFINITY_SET when affinity->is_managed is false: kernel/irq/manage.c:irq_update_affinity_desc() { ... if (affinity->is_managed) { irqd_set(&desc->irq_data, IRQD_AFFINITY_MANAGED); irqd_set(&desc->irq_data, IRQD_MANAGED_SHUTDOWN); } cpumask_copy(desc->irq_common_data.affinity, &affinity->mask); ... } When a platform driver requests and starts an unmanaged pre/post vector, irq_startup() -> irq_setup_affinity() sees neither IRQD_AFFINITY_MANAGED nor IRQD_AFFINITY_SET and overwrites desc->irq_common_data.affinity with irq_default_affinity, allowing the interrupt to target isolated CPUs. Setting IRQD_AFFINITY_SET in irq_update_affinity_desc() to match alloc_descs() would preserve the confined mask on startup. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129045436.2553= 64-1-atomlin@atomlin.com?part=3D10