From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E788C4307A5 for ; Wed, 8 Jul 2026 16:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528183; cv=none; b=To2qiOe85qb7WpRKpvxBht3CYXvhhAqqizYq8eIu9HmIKp5mmovj0mLpMzOKRJHPwIBLlf2JkrO4Y0aj74I0aUtfysHFGa47MdP8ClKkUUXzoZwgzWdaFX8LfVcpRFDvwXxwgNOyycY+miGrSu95yx+/h2VyUr3Z+ZDabzU3e74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528183; c=relaxed/simple; bh=kx01jwO99d/D/+VBgeHKZk1myPbHRYX5QpS6dn4LYPk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uyAkErae3Ud3vEBpeGwxbIdPOYDTvOGnhfxEOsSrpklLaKQkSSn0v4mqtiK5pYP+ka4D5Am7QpoN9Y8BfTa0pFBSfeevhilpP2Gr+XHJMNlhKJB+hppcrjNzRd4PdC6qP8gEGasg+wGVECk6rP/+IOV4xn2kIySG392LamxxveU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KgPuWWyK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KgPuWWyK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 637251F000E9; Wed, 8 Jul 2026 16:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783528182; bh=f64jl3BaXzKdN/w2MqLTa5/kkcxUYIrofOBmp2T7Bzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=KgPuWWyK5zL7D1DuBbibg0dJ9DVj3cjvNHccWMZCTK+0QtJ6Ne1NzZwQ/uQDQ7yQe /WegJvKijb4rFFcMhuDaXBpJ9yDv9RBvDMWktB60o4fZnlo4JLVlfZy/ZuUeya4/0n /0U4rcYMGvoJgoRXqX9ZfE3xWtAP2/lbIAPtIVAA39CweX4MP2R+j0Q3zNFanJYauw CJHKIk7qXJgxCbCE1nRKRRoJTuiouMPx64LOkJPrQHNVF+O7ZK1PuqZJrszoknrtyI cNQIDCNmZMpeTFAjsV8zkA4mGYAGFNiI94lBaz2pE15ysp7RXqndvHvFF8/2G2XzRX T5Fsfu2OX9okQ== Date: Wed, 8 Jul 2026 06:29:41 -1000 From: Tejun Heo To: Frederic Weisbecker Cc: Marco Crivellari , Breno Leitao , linux-kernel@vger.kernel.org, Lai Jiangshan , Sebastian Andrzej Siewior , Michal Hocko Subject: Re: [RFC PATCH 0/2] Add queue_*() functions and prefer per-cpu workqueue and flag Message-ID: References: <20260505161658.401998-1-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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jul 08, 2026 at 03:58:58PM +0200, Frederic Weisbecker wrote: > Le Wed, Jun 24, 2026 at 09:46:55AM -1000, Tejun Heo a écrit : > > Hello, > > > > On Tue, Jun 23, 2026 at 05:13:31PM +0200, Marco Crivellari wrote: > > > > - At boot time, allow selecting whether to back them with percpu wqs or > > > > WQ_AFFN_X unbound ones. Maybe we can even experiment with default to > > > > WQ_AFFN_CPU. > > > > > > You mentioned here "at boot time". What about making this also dynamic, > > > "moving" the WQs with WQ_PREFER_PERCPU away from CPU N when N is > > > isolated through a cgroup isolated partition? > > > > Yeah, being dynamic is better but switching dynamically between percpu and > > unbound workqueues feels like it's going to be complicated. I can't think of > > a simple way to do that. If you can, please be my guest. > > I fear it's necessary to have dynamic isolation working correctly. > One way could be to make wq::cpu_pwq point to a pair of pwqs. One > for the isolated -> unbound configuration and another one for the > non_isolated -> per_cpu configuration. So, if we really want this, I think a better way to go about it is probably going deeper with the restructuring and just merge percpu and unbound workqueues. Unbound workqueues already have the ability to update pwqs (or rather install new ones and drain old ones), which is how attribute changes are implemented. If we make the pwqs be able to point to both unbound and percpu pools, the dynamic switch falls out naturally and percpu just becomes one of the affinity settings. Luckily, recent developmenets on unbound workqueue side already brought it pretty close to percpu already, so hopefully it may not be *that* complicated. Thanks. -- tejun