From nobody Sun Feb 8 13:13:17 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 B2DF21E1A05 for ; Thu, 13 Nov 2025 16:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763049977; cv=none; b=Pg49YW8l0DkMm/3M/rRg2zIgjPgpnxQr2fGlOtFOOECXGBfzGznK0LfDUeSDUk8pPGxp+3ajEJoW4u5ELbCgqqn2BIkGzcanZcqYGPDTj4SYrkOmsT3TVadztcVxN0bPii0x0nIGMVbD6HLNNQeZnFgN3czIv+iCSR8SEp9PoLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763049977; c=relaxed/simple; bh=K7xt323VJ1uJRwqxUQs4bzCVCzNHYNwFwbiulRpdL5A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rX2NIISTBPg5iF71zZtiqf8nveJpqveHKFPitQow/WGaZBXlLEwoOpL3C4WMmV390E8Cku5YNDE44amprHqs89cVrv26RuGC9Fe1bCAjvxtllUf2wAo5IC/3OBHznhH60aCmfDIHo2fCtTAOX1COUpicA3u+WQDT2e4794L7wwE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=hFEfF5BG; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="hFEfF5BG" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-47112edf9f7so5159545e9.0 for ; Thu, 13 Nov 2025 08:06:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763049974; x=1763654774; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jih7gSI3dbyWiOmzQIAyW8PRU2Q1lIgEuIklK2h9qCU=; b=hFEfF5BGpfnMohemUnzclnr5rC19eZVo0/h+cbeTXZOQqvDtCCAsEKq4y5CluuQUqw gTGry9sngYbCBQF/b+rPRzOh+euMiFjIN118NTjySuhApK/gjvlRLsdWnw9VV52Q5zGa mMFWl0+VLXwquA1PWXmC2vDB0lbwoovOxTx7UE0vzo5okRcq+qVcXRbWFDk/9wdOic4P LrPx7bgN0tzUKoITf0sxEHi2/8y/bNxtn/glLI/t+FaCu0SX2+X3s/EacVl4E64xE9BG XBEFPlDeAsccwaYaVHMYMZ5RyLTjdIRuH1YjURe4cIirGvF+loKNQLs59o75UNs4moxa I3ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763049974; x=1763654774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jih7gSI3dbyWiOmzQIAyW8PRU2Q1lIgEuIklK2h9qCU=; b=iXReFyOrLJ/ccmx6LJJZQcLIhRPTZp7Y3Q3XC8n+RkzntkdH3jY1TXOshMV3uIOMX+ k8rI3i3eHohrhTnMKQNXMhgYVXiX9VExXKQj9I0KUEBY4UFvEg4dMonsPSlwjxXcPOYE b2nIvZXRQpaqNfXJfQuFg6vDPfjzHf9l90Z+qiPc/hFY68QmnAfZUpyB7mJGqYJ95t8X z43lJLeJ5EYgwZpQu4Eb8usRD/DkavkKim5x18c1VrK45q2c7M4EDDPnS2jaokEqa7TP bmePCKxU6h0S/FQl1A3KlgphYCm9aztx8foasmrD3kHRT89pG+C1yX2UfmI8QCqq0CsZ tfMg== X-Gm-Message-State: AOJu0Yzs96Ln8pB5B+zPgt8AjYjomHfM5Oi1Zpiv6WYiSqTq+amgdHBA q2/8oXbt9NE5A9XTAJwHbP1YosGqFEFDuSMjCxfW9TIjfWiapLR1UqWxltHsoCENZOJ735X/N8l hWdwA X-Gm-Gg: ASbGncvcnOP3KPx/YZ8OA9qsT41H0DuboK5ZYEQq0S7wMdk96n1GWESJLnE/lzs99C3 a2QgBj6rjZq4uvOvavZ+5flLxOj8vPQF3YWf7b3d1f4BuDNqQzNwcar5n9cyGSozoa3Zg9zm8iW uFmimIYTC0RZQcDd3h6gBCrIFruOKYQRzBJGmz6BPWaNZnNrY9lb39m+SAjsmsRoIMXt0dxcnxx 9aFwArIa3VG6UmAKnQDeRELHJ+fGnxZDuvVOZq2JfYppr2LFjzXOVetLfGmkAhucprIb6mD5bKn Ej8pEeTq21Rs1uxu2f7bsrAbh5TCcBGGjbldY4Y15HZxYUYizCMHTYO7MHdal2tV+WTSlUMFnBW WWKf5+pkIo0XBnG3l49rP7RNloFB4glCE99Kgp7Ej4xbf0IzygCYrC8l/SqZ2oC4vNp5lIMXPkq 5fUGwzUnObZ1eHItw1qyxB2Map X-Google-Smtp-Source: AGHT+IG/TUS56JtJew2HLvlhyV4PRkjY0fBbwkOSF9xrNpWgIoGxEVrZD8+bc1Az1z0UWDTcxn4JZg== X-Received: by 2002:a05:600c:1f88:b0:477:be4:7a52 with SMTP id 5b1f17b1804b1-477870b62d3mr63554405e9.39.1763049973769; Thu, 13 Nov 2025 08:06:13 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4778c847c3bsm41595415e9.2.2025.11.13.08.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 08:06:13 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Ping-Ke Shih Subject: [PATCH 1/2] wifi: rtlwifi: add WQ_PERCPU to alloc_workqueue users Date: Thu, 13 Nov 2025 17:06:04 +0100 Message-ID: <20251113160605.381777-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251113160605.381777-1-marco.crivellari@suse.com> References: <20251113160605.381777-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="utf-8" Content-Transfer-Encoding: quoted-printable Currently if a user enqueues 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 consistency cannot be addressed without refactoring the API. For more details see the Link tag below. 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=E2=80=99re needed= and reducing noise when CPUs are isolated. This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: 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=E2=80=99t explicitly specify WQ_UNB= OUND 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 Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ --- drivers/net/wireless/realtek/rtlwifi/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wire= less/realtek/rtlwifi/base.c index e26feb8de658..2786e4ee67eb 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -445,7 +445,7 @@ static int _rtl_init_deferred_work(struct ieee80211_hw = *hw) struct rtl_priv *rtlpriv =3D rtl_priv(hw); struct workqueue_struct *wq; =20 - wq =3D alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name); + wq =3D alloc_workqueue("%s", WQ_PERCPU, 0, rtlpriv->cfg->name); if (!wq) return -ENOMEM; =20 --=20 2.51.1 From nobody Sun Feb 8 13:13:17 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 0F40D2FAC14 for ; Thu, 13 Nov 2025 16:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763049979; cv=none; b=cFEWAo3CyGTBaCO/iOUMDFOG5Xib+krBQywIM02ueqJAqzIOEzQ7xIP2HrfFQPo3Ei0xAAoVubJ7WrEudvUl8hQ+StAN2m6HUp/j+lLFjvf8s0SH4JeLqn6ixMatxl5T4dh+Rs+CdjkB+NZKg9wLW2oHAQX2l09iWZOWqJ8mnkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763049979; c=relaxed/simple; bh=b3j/Wc2OtToDhvUSwLsZ2/Rbg5MWETd3kh7hoUyLCzk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jqhs2OePTbk/Zsn3vx8wlbB7s5pTUkhAbn3TqCH+30hCMdcD2yGJlXf6U03ow5DYfu0j5NcWZHx5iDuGe9LBLjNTVKzeANU8RMYvw98fFTHYi2DrHQXzCpEil/mOnjf8sqdTerznbS8SgsHAuk/FYnACbCUgvNYO5hFMB1kRD08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Yinl5a6g; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Yinl5a6g" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-47754e9cc7fso6343515e9.2 for ; Thu, 13 Nov 2025 08:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763049975; x=1763654775; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kpDVepX3vNSmI1FdDJpGJYu0mEkDdjVxk0Pg0gfi31Y=; b=Yinl5a6gSY2eO6MLnKyBW7Hun4Dx5rxl/RufZ2cR9Msl6eDU16Y99NiZwEYodT4zsw 9DHA/graBfUXPSeDbgA1zV5J5YgDJO+Blh21WjHSX8Ads7KfuqyL/DNTnl6dkg+vojM7 xxaYAPnodNVKjDCDevpfNvhV3CZqIXVhUVBGDPu+3lP8HuwSPbCX6yWomkFKMN1pvKaq h05KEzGBqjRw1sNRLPQi3PLn2KZFfedd8zH2kIIxfMx6e6lElEv0BOV9KbSr2oNj+chY IMcMrl5vJbTaZ9wUffls5n1DBJy0yUBThqZ34ng8DbvWtJPj0wg09rxb57DMFxGrfvyz u1wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763049975; x=1763654775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kpDVepX3vNSmI1FdDJpGJYu0mEkDdjVxk0Pg0gfi31Y=; b=PtaXOMVqKOfl3HsYZv+3qn5KfWF5d0ixPmu54Bh0MlF1B2Am5tKYJVNM0FzHYEqAuM 7SFrdfsvZ5iWwyy8X5DWdTjQ3LWR8qJXFuy2r6f60dgmVCaF2zd5zLJiFtUdiXWH4LCs Yc+A7Jy01dwnDueaZkpKOJyM71COdqvj4QhtEpdzsOH6Lsg6Omm4QG4vH7jbl/FOdwD0 epqbiWHEFREjzO6Aopy5eeqn2C6AvPoudXcTZzq3sPtqMPqzqR+2EkWC2t/4BC39Kvue u4CmLJPYS477zVAPeQbwHLhTEOjAR/jepar3VRUlqkvnEkoW1t9/gR4zALeteQ/js2nh LAUQ== X-Gm-Message-State: AOJu0Yx1JHl1pL2bkiYRP4tcsjdOdXA7LHs2rPN6dchm1+oonqFLc8Ad FY+pr919vGaUzTbvs1EKlFEs/EU0riHSdI+TuyNypQlcyVfoNqzjyM40Sa5TMLwhQEBXunOOSFK 5s6pi X-Gm-Gg: ASbGncsuRsi+SfqMbcQOsmCKMF09ipLnd9EE79YpLTWvkqgM2Ua+LSkEWSkc5y5DlTd Nh4UMgVQWnyJtqKdChAQuYH1vHJ0s48hqwtFdy8dR37LOSUpXoJD+Bl1ix5utf0tDTduljcq7Kf 1w0/OcTasolGiYOomtvkYR/L3js6is3EY9FEPcAd4phNB3wYThS899vJ5oU06935DyFD+eSkK46 rC9r5bZOBgny2ZxjtlY3mR4af7JFM7dG0GTMCokTxpQrjGgjeoGxbpc51OpgtaigX+e+bRztnOb xgzrTFIKW9J0sNTYCb8ffKElk43GRHDdn4paSEs5MjXbY+h8tbVKTdcPfS1GI6ECe0QYbPSn7Aa MEcm4ZbM+EwfEi9Iaou491Dy64AD8epqNhte+zDi9sMpt0D3SKBomhrz7LkJPVN8k2rMM5p3zaC MJb7XuMOxUpQSRGRGUQLkK7fT+ X-Google-Smtp-Source: AGHT+IHTIqN3sACYJ8L+s+DSf5fK5S59AG1bon4iPbb6kvAdV+dUJTAIosw5brBjEKYuiUfzpCW4SA== X-Received: by 2002:a05:600c:3b1a:b0:471:989:9d7b with SMTP id 5b1f17b1804b1-477870c4f26mr71238165e9.21.1763049975028; Thu, 13 Nov 2025 08:06:15 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4778c847c3bsm41595415e9.2.2025.11.13.08.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Nov 2025 08:06:14 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Ping-Ke Shih Subject: [PATCH 2/2] wifi: rtw88: add WQ_PERCPU to alloc_workqueue users Date: Thu, 13 Nov 2025 17:06:05 +0100 Message-ID: <20251113160605.381777-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251113160605.381777-1-marco.crivellari@suse.com> References: <20251113160605.381777-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="utf-8" Content-Transfer-Encoding: quoted-printable Currently if a user enqueues 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 consistency cannot be addressed without refactoring the API. For more details see the Link tag below. 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=E2=80=99re needed= and reducing noise when CPUs are isolated. This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: 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=E2=80=99t explicitly specify WQ_UNB= OUND 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 Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ --- drivers/net/wireless/realtek/rtw88/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireles= s/realtek/rtw88/usb.c index 3b5126ffc81a..db60e142268d 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -965,7 +965,8 @@ static int rtw_usb_init_rx(struct rtw_dev *rtwdev) struct sk_buff *rx_skb; int i; =20 - rtwusb->rxwq =3D alloc_workqueue("rtw88_usb: rx wq", WQ_BH, 0); + rtwusb->rxwq =3D alloc_workqueue("rtw88_usb: rx wq", WQ_BH | WQ_PERCPU, + 0); if (!rtwusb->rxwq) { rtw_err(rtwdev, "failed to create RX work queue\n"); return -ENOMEM; --=20 2.51.1