From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796284161; b=ChNsHLVTno0dsC7+p1b0ZSnmzKMq/ozQR03+V+QELiFyJCDAZYYuy9MCTu6AmVSwyAg3 51yRuNglR+5zBQS2eIqxNTGPfa9J2Y7j5pIMnltWgZ4G9ooRZxHDJWyuZSx7D+C65En/o 2uQkE6A3O/8KKpVhtoEuUe+zU7hNGMV5W6GagLsi2WDLFe82P9vzWwajT7bQV2HVI+vGt E0ZaoFUvWQPluscxtYkS//fni7yH92V6b02Wj4RlVSjBpFFoFZGSMvvRr34ntk2R5dw4Z co1s4Cu2mpfkQxcf3hwPj0NzOyGq2B2okND7C1whtDijqsonVVuH3q32Qki6YlYVF6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284161; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:DKIM-Signature: DKIM-Signature:Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Spamd-Result:X-Spam-Score: X-Spam-Level:X-Spam-Flag; bh=d5LE45Wuq7qogoP9gBbIgRYV61DvnN+diY1Oj7EJFqw=; b=uxEk8A+m8OZr1mtuQOWGvKxTUdUNZV18JRV6I5g2FZa7Sw1GDQvY7kEH2CAqPGz8bgPI QXHipU6YueBGure6GxHSudhxC40Ht2p8imgzh2r1oOfdEJWQ1dqxFKx9NP5EIse1FlM16 oHZwNWPxceAnjRPzlR6uJO3M4PWu7yj2B/kxhtnYI3iRCyD67e73zmpjA9cVpXFN8dZAC TkoMdLYdjOhISg2fkyDqtQUxY0EkNvi7XfT/cXCWO0OtkdFBigHCIlrJg+O/2i5fE1Cav B9j//AQ1dOLckihrXsJUQBqNjKhldFkOiJ/SdEz15Prf2efU7IyQUo4MLJfTFBejrcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ow8WSgY8; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g6ZHraTK; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ow8WSgY8; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g6ZHraTK; arc=none smtp.remote-ip=195.135.223.130 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 B3716606A32C; Thu, 3 Dec 2026 07:49:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B3716606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ow8WSgY8; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g6ZHraTK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ow8WSgY8; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=g6ZHraTK Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BCAFB34C73; Thu, 3 Dec 2026 07:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796284157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5LE45Wuq7qogoP9gBbIgRYV61DvnN+diY1Oj7EJFqw=; b=ow8WSgY85u+i6ViL0gf0MnJGzorlgFPiUXf8pb3FOWMWzf8HcudxTTzYgwAtPEVVk3jeUE +RRM439RK+vF/naQN6H+LhbD6B4nQ1lN31qq5oR9tdxkr8zxAPuQq4tP9pO/BokpKVW8PB HSjeAYB173tuYlLZbRsmiZEcYE3DJb8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796284157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5LE45Wuq7qogoP9gBbIgRYV61DvnN+diY1Oj7EJFqw=; b=g6ZHraTKg9Kh4YvUDFknMieeDQuEOMmKN4LMpJqkIT5KmYXAKYWS1y11oXM/H94IzjByOp q8PZ1GseSe97edCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796284157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5LE45Wuq7qogoP9gBbIgRYV61DvnN+diY1Oj7EJFqw=; b=ow8WSgY85u+i6ViL0gf0MnJGzorlgFPiUXf8pb3FOWMWzf8HcudxTTzYgwAtPEVVk3jeUE +RRM439RK+vF/naQN6H+LhbD6B4nQ1lN31qq5oR9tdxkr8zxAPuQq4tP9pO/BokpKVW8PB HSjeAYB173tuYlLZbRsmiZEcYE3DJb8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796284157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=d5LE45Wuq7qogoP9gBbIgRYV61DvnN+diY1Oj7EJFqw=; b=g6ZHraTKg9Kh4YvUDFknMieeDQuEOMmKN4LMpJqkIT5KmYXAKYWS1y11oXM/H94IzjByOp q8PZ1GseSe97edCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5449B1348F; Thu, 3 Dec 2026 07:49:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id FTyJCvweEWtteAAAD6G6ig (envelope-from ); Thu, 03 Dec 2026 07:49:16 +0000 Message-ID: <0a743abb-a012-4ea7-9660-75256d3faa39@suse.de> Date: Thu, 3 Dec 2026 08:49:15 +0100 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v17 08/10] genirq/affinity: Restrict managed IRQ affinity to housekeeping CPUs To: Aaron Tomlin , 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: 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 References: <20261129045436.255364-1-atomlin@atomlin.com> <20261129072612.257915-3-atomlin@atomlin.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20261129072612.257915-3-atomlin@atomlin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-11.79 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; TAGGED_RCPT(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[37]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,outlook.com]; R_RATELIMIT(0.00)[to_ip_from(RLxytqtu68cujj4wfi14kxder6)]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[suse.de,redhat.com,gmail.com,windriver.com,lwn.net,linaro.org,infradead.org,rendec.net,linux-foundation.org,abita.co,ashe.io,suse.com,outlook.com,vger.kernel.org,lists.linux.dev]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[atomlin.com:email,windriver.com:email,suse.de:email,imap1.dmz-prg2.suse.org:helo] X-Spam-Score: -11.79 X-Spam-Level: X-Spam-Flag: NO On 11/29/26 8:26 AM, Aaron Tomlin wrote: > At present, the managed interrupt spreading algorithm distributes vectors > across all available CPUs within a given node or system. On systems > employing CPU isolation (e.g. "isolcpus=managed_irq"), this behaviour > defeats the primary purpose of isolation by routing hardware interrupts > (such as NVMe completion queues) directly to isolated cores. > > Update irq_create_affinity_masks() to respect the housekeeping CPU mask. > By passing the HK_TYPE_MANAGED_IRQ mask directly to the topological > distribution function (group_mask_cpus_evenly()), we ensure that managed > interrupts are kept strictly off isolated CPUs. > > This patch additionally addresses the architectural constraints of > restricted vector distribution: > > 1. Vector limits and multi-set scaling > > Updated irq_calc_affinity_vectors() to bound the maximum number > of allocated vectors to the weight of the housekeeping mask for > single-set drivers. For drivers providing a calc_sets() > callback, vector calculations continue to scale with the > driver's requested set sizes (maxvec - resv), preventing > unnecessary queue contention across distinct functional sets > while irq_create_affinity_masks() guarantees that all allocated > vectors remain strictly restricted to housekeeping CPUs. > > 2. Multi-set alignment and leak prevention > > When isolation constraints result in fewer available masks than > requested vectors for a given set, the remaining vector slots > are padded with the housekeeping mask. This replaces the > historical irq_default_affinity padding, ensuring excess managed > queues do not leak interrupts onto isolated CPUs. > > 3. Minimum vector safety net > > To prevent fatal -ENOSPC device probe aborts on heavily isolated > systems (where the housekeeping CPU count might be lower than a > device's structural minimum), the final vector calculation is > safeguarded to never drop below minvec. Queues will safely share > the available housekeeping CPUs instead of failing the probe. > > 4. Zero overhead > > The housekeeping mask is conditionally assigned via a direct > pointer, completely avoiding temporary mask allocations (e.g. > alloc_cpumask_var) and bitwise operations when CPU isolation is > disabled. This guarantees zero performance or memory overhead > for standard configurations. > > Tested-by: Ionut Nechita > Signed-off-by: Aaron Tomlin > --- > kernel/irq/affinity.c | 29 ++++++++++++++++++++++------- > 1 file changed, 22 insertions(+), 7 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich