From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DBE5347FC7 for ; Thu, 6 Nov 2025 15:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762442116; cv=none; b=W3UmacBeqXa6+/LiaNhTF+11f1qKiZQP2KrDk3hwUfdXwdbQiXNYM+UJ6yr9MVqpVFw/ezyCJ01HgQp8JuKfSiL7csdXjos8gCWQ6zpXY3/3p/gETmnoygHcUYUsOpJwV2MEblL8TOKdrBFZ5SjcgjPG1FSBQyQGOM+NJABiX9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762442116; c=relaxed/simple; bh=AGynmWE/RVZQ6vbhtfmeLul8NfKvZ0IwBuRGUX1PJdo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pFmnc35ZpfqA49P46M+SGwVJcC1B3C1nSYAYW9jdtys0VJZaIS7gqBe+fcWxyKqWzDYSmTQ/dPj53d5JsMiCGSRZXldD3qvqfpzgLBnmtGxYnGeCU3XPnYfFbFGMrfhtreyDvnHDePhP4KFfq3z5kW5qla9ZAmTlc4G/N0E2wqw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=y4JaMSEd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=5LWJ6PmH; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=y4JaMSEd; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=5LWJ6PmH; arc=none smtp.client-ip=195.135.223.131 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.b="y4JaMSEd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="5LWJ6PmH"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="y4JaMSEd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="5LWJ6PmH" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out2.suse.de (Postfix) with ESMTPS id 761931F74C; Thu, 6 Nov 2025 15:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1762442111; 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=G95FUFm53FQxkE+swRlWeZovYk4tjDQwf6aPWEzh9Ng=; b=y4JaMSEdG5WgPycjI4t5RXesO6VwkuTizGiiela1BuT7wMZ1e0KuMUHZ2s9Brl6/gETSNY HRV2S16ZWViywCEKk9hODGOPhG45zv/p4ioXss/vQGnpkkVqrEL8cRGZI8A1eS7fnm82jq Uezv92nNmUUTknyAmYy1Gzj8xCGZoq0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1762442111; 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=G95FUFm53FQxkE+swRlWeZovYk4tjDQwf6aPWEzh9Ng=; b=5LWJ6PmHLqT3QRkfdW+j0/m03/L1xDcpEcYhQ2PZuldOV14E889dBfcmVQuvD4826nmV1A 0RrfFULweLq6edDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=y4JaMSEd; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=5LWJ6PmH DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1762442111; 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=G95FUFm53FQxkE+swRlWeZovYk4tjDQwf6aPWEzh9Ng=; b=y4JaMSEdG5WgPycjI4t5RXesO6VwkuTizGiiela1BuT7wMZ1e0KuMUHZ2s9Brl6/gETSNY HRV2S16ZWViywCEKk9hODGOPhG45zv/p4ioXss/vQGnpkkVqrEL8cRGZI8A1eS7fnm82jq Uezv92nNmUUTknyAmYy1Gzj8xCGZoq0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1762442111; 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=G95FUFm53FQxkE+swRlWeZovYk4tjDQwf6aPWEzh9Ng=; b=5LWJ6PmHLqT3QRkfdW+j0/m03/L1xDcpEcYhQ2PZuldOV14E889dBfcmVQuvD4826nmV1A 0RrfFULweLq6edDA== 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 5BAE1139A9; Thu, 6 Nov 2025 15:15:11 +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 wZbrFX+7DGlNcwAAD6G6ig (envelope-from ); Thu, 06 Nov 2025 15:15:11 +0000 Message-ID: <00acca6f-b0d5-48bf-b7fe-c00d941c63c2@suse.de> Date: Thu, 6 Nov 2025 16:15:10 +0100 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] scsi: fcoe: add WQ_PERCPU to alloc_workqueue users To: Marco Crivellari , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Michal Hocko , "James E . J . Bottomley" , "Martin K . Petersen" References: <20251105150336.244079-1-marco.crivellari@suse.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20251105150336.244079-1-marco.crivellari@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 761931F74C X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[kernel.org,gmail.com,linutronix.de,suse.com,HansenPartnership.com,oracle.com]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[10]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.de:email,suse.de:mid,suse.de:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.51 X-Spam-Level: On 11/5/25 16:03, Marco Crivellari wrote: > Currently if a user enqueue a work item using schedule_delayed_work() the > used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use > WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to > schedule_work() that is using system_wq and queue_work(), that makes use > again of WORK_CPU_UNBOUND. > This lack of consistentcy cannot be addressed without refactoring the API. > > alloc_workqueue() treats all queues as per-CPU by default, while unbound > workqueues must opt-in via WQ_UNBOUND. > > This default is suboptimal: most workloads benefit from unbound queues, > allowing the scheduler to place worker threads where they’re needed and > reducing noise when CPUs are isolated. > > This patch continues the effort to refactor worqueue APIs, which has begun > with the change introducing new workqueues and a new alloc_workqueue flag: > > commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") > commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") > > This change adds a new WQ_PERCPU flag to explicitly request > alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified. > > With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), > any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND > must now use WQ_PERCPU. > > Once migration is complete, WQ_UNBOUND can be removed and unbound will > become the implicit default. > > Suggested-by: Tejun Heo > Signed-off-by: Marco Crivellari > --- > drivers/scsi/fcoe/fcoe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c > index 4912087de10d..c8c5dfb3ba9a 100644 > --- a/drivers/scsi/fcoe/fcoe.c > +++ b/drivers/scsi/fcoe/fcoe.c > @@ -2438,7 +2438,7 @@ static int __init fcoe_init(void) > unsigned int cpu; > int rc = 0; > > - fcoe_wq = alloc_workqueue("fcoe", 0, 0); > + fcoe_wq = alloc_workqueue("fcoe", WQ_PERCPU, 0); > if (!fcoe_wq) > return -ENOMEM; > 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