From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B883031BC9D for ; Tue, 16 Sep 2025 20:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758054908; cv=none; b=k/zUeUpfFUuBStmlER/Feo08mJFmwbRkFDQpd6v59qIUmz4L+5gMtI6dfO5zbCNqK/XlaQwaKfcS6QP2tpIj77OVDu73Kht6C5pzIlrHvcXaWPD9+kd9KMMFbDOe1Pl34EVR3V2m6j7mAscSpplgQOJtl6D+6bNrxbR1EhGTWWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758054908; c=relaxed/simple; bh=QyCMXi01YRgiNm5XeMkGS/vMIHfEeyOTHut8SMzsyWg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JCvnsD2a2yCSCqzbOct0wJ3n4bxC607rYdTnU6gTKaJ4SgIDAV3ezHqYsRUGind1b3DCWCgXSyIYIYxg8OWua7lue66BpeebDRNQowXO503IIHdaybWoktbWZ7UrmcbFh1RkH+vpgKX00q5JO+5nZyI/A7rjaNq35lgQCg2cPJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ksCssMJk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ksCssMJk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BF5BC4CEEB; Tue, 16 Sep 2025 20:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758054908; bh=QyCMXi01YRgiNm5XeMkGS/vMIHfEeyOTHut8SMzsyWg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ksCssMJkHC1fJm5afHLr48d8QOmObUEluTWdhYmp3YBvQlp9KLzCY1/wSDDxkhkUz RoR4oBGptykrTWdUYW1nYV2qcRVY6R1ttwYsrkUmEh0ZIFjbgbcfolQzpvnuLZfwpM QtjWjWCNLwdDBtOH8gweCybCoAU/zLycs+DTttM1pyZXsRCTqy8fqBGI+30yLjROHw n94wfGxqT9Z9mGQSjG0BaB6z30RDdhc2WujAqannNfz49RdDAeoxpKgtZLmgdRHy64 rUhw+2ttL9ziVuBaixdCzyuTScBqYfHtO7kdiBOvRKi8NUt5XMK+qqelEDYsq6YF8t uMywT6owDHMLg== Date: Tue, 16 Sep 2025 10:35:07 -1000 From: Tejun Heo To: Marco Crivellari Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Michal Hocko Subject: Re: [PATCH v2 1/1] workqueue: WQ_PERCPU added to alloc_workqueue users Message-ID: References: <20250914134426.43269-1-marco.crivellari@suse.com> <20250914134426.43269-2-marco.crivellari@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250914134426.43269-2-marco.crivellari@suse.com> On Sun, Sep 14, 2025 at 03:44:26PM +0200, 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 adds a new WQ_PERCPU flag to explicitly request the use of > the per-CPU behavior. Both flags coexist for one release cycle to allow > callers to transition their calls. > > Once migration is complete, WQ_UNBOUND can be removed and unbound will > become the implicit default. > > 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. > > All existing users have been updated accordingly. > > Suggested-by: Tejun Heo > Signed-off-by: Marco Crivellari Applied to wq/for-6.18. Thanks. -- tejun