From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 1568834EEEF for ; Tue, 18 Nov 2025 10:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763461256; cv=none; b=RMftUKPad2NsCoZagLP/9cVEZBlmfyQl4XV2wuCLB1yuqetYaOMehbp8owRXWNgm2GQLKeZwfKqe34jZL4R3jqtKrhF9lRxMZtCNYY0NyqkS/kc0vBv1XEwXnEHABQYe3rhEhjs6JOPzzogGZImPcGQHPS1j4dyIGCC4Rx6QyHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763461256; c=relaxed/simple; bh=GEVpPGRVeFN0IJ+S9fxq6FovcATwQ/QwDVCZ5fl5Kx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XYUuMnqrdqqJgJ7vtCRHkOZMbfsqBdQxSI5WxoaFr/QYBKd/QnNZqPAib2LDWbW2OsO8doAJSHE7q+tvCnbr5FAPT3RN9rimOoe+IBLuZqrh5yoWS44Bp6KJGD65Ibi4jNUoRX9WjWZlO0ZxrljMeFVUPl76mIKy+cCMp9QsyLQ= 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=WJaJF4Z3; arc=none smtp.client-ip=209.85.221.41 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="WJaJF4Z3" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-42bb288c17bso1725189f8f.2 for ; Tue, 18 Nov 2025 02:20:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763461247; x=1764066047; 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=SbBTDMN3+ZEqQ0u49htO9gJAirx33h7wnVKphKwscK0=; b=WJaJF4Z3sgWQtKRX83UTfv6V19jnuA4Dxr0kjUYadnxpXhhzPSMpD807jY2eio88AN 7/gpRq6jB3YSHJMCps/JhV132vhKJt3mxbnXDlfqfcKlVgZe6f7g/5gyQdHPrMi3OFKE hp2H2Ci1XqS9q8dlLCVz30fcaxNTYyVtWasWFydR+nPP1AO3T7DBHmjL+heqF8TUaqFV vUC8ccZDftS2mH/Ryw9QF7KXTRekt4cfmjnBg+vrIju+qynFa2c/PG4rUZDu3TxuZoDF aDjYb8hnLPSzu2TFuoRxyyIERNF3XZPROoubrKXvFt8bWuWvbS9zPv+g3Ie4HrX2ODeA +KSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763461247; x=1764066047; 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=SbBTDMN3+ZEqQ0u49htO9gJAirx33h7wnVKphKwscK0=; b=Wsfd0k+6GJ1dMU4TtRNN7K1iiA0vUSq+CLLq53VTPBS3lYmgjlSS19zHrEG8KbTYAZ hrms043WmsTop/Yu1OUvhO7WxhwvwANL+PCGWX4CgS0Gn7RURUstmKSyB4f8WHyEbazu Hi0q6iXV6TdyKwOqBokCtmdWuhewj8DYH9ZRyTLnA6P02M1RxZXv/ujM5vtBbrtCWGU4 eFonhu4Gu+kSzfYSDhQ6/a5dejp+XKwWRamu7rDSzdf/G+A8dmGZY3tvTQSqr6tuRVJ1 3zjJ0vDsRGp6GRO8Nz9yWVv756qXgfQfpUa2QP+l+pVn7w4Q4BG6Pccb+pDqWHua8Llz 0W6w== X-Gm-Message-State: AOJu0Yx9Wt76JCRUnRS9g2KHJ9Kf71kpG8o8UE3/R1v8rXbufs1xaRxX Mc+fTuv3a516s9HLKUESFlKyXf6sjFjd2v6BPlSBV5KmUow9DQ7f/STJDiMdeL8LHHqPt3fYmVm BllTW X-Gm-Gg: ASbGncsjii3rtTTfqq4LBufNc7YCcmJLOD8NCFH+0cXmmG6E+l1/eKtLy2h08SKV5VD VozjojwtJALGQs9a9BpZDtYOPLBEg0XCIWZk+2cBdR74N8kvhDW58KgSapiCxH9A4AiCzIvzEFS CZVko8R+lu8YVbIgYgJRnkjYBtn1Qf5b+dm5HRD/n9DJOsDHvR8ho5hDFSNLlK/ei3wz0PbH+iq 83KfmAq4Ae39KQ/qEX9Hfj7xy62oq+AGGSaziVhV9z3Tl507ILssnHTI5/2qrNac2xVEKM+bnBg DqGO/QE2ZpG4m4eYMYP0cGcI6aWWnHBzkNFV7JrbDTV7OfTgKIf62+y16yWgAli8jn0DbXDDEvO gfaSB3JpkTu/L9yQQD2UTJn9FYSz0DF+zqR2vwftzxuaKuP7nMKzDgvyR+czlpa3dhmBWpv5ye1 6/XOqiYj5gS0HQHMXq8T5de91e X-Google-Smtp-Source: AGHT+IGPcKR/wlZP0UldFikZNR1qvyTXS05hdw1j6Pn0ZSb6p7TS4PXtopCsP93ig0mpQ/gP2QP65Q== X-Received: by 2002:a05:6000:4285:b0:429:d0b8:3850 with SMTP id ffacd0b85a97d-42b59373560mr13427757f8f.48.1763461246876; Tue, 18 Nov 2025 02:20:46 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53f0b894sm32147587f8f.26.2025.11.18.02.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 02:20:46 -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 v2 2/2] wifi: rtw88: add WQ_UNBOUND to alloc_workqueue users Date: Tue, 18 Nov 2025 11:20:32 +0100 Message-ID: <20251118102032.54375-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251118102032.54375-1-marco.crivellari@suse.com> References: <20251118102032.54375-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: 8bit 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’re 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 the WQ_UNBOUND flag to explicitly request alloc_workqueue() to be unbound, because this specific workload has no benefit being per-cpu. 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 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/wireless/realtek/rtw88/usb.c index 3b5126ffc81a..009202c627d2 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; - rtwusb->rxwq = alloc_workqueue("rtw88_usb: rx wq", WQ_BH, 0); + rtwusb->rxwq = alloc_workqueue("rtw88_usb: rx wq", WQ_BH | WQ_UNBOUND, + 0); if (!rtwusb->rxwq) { rtw_err(rtwdev, "failed to create RX work queue\n"); return -ENOMEM; -- 2.51.1