From nobody Tue Dec 2 02:57:05 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.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 C87C63064A7 for ; Tue, 18 Nov 2025 10:20:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763461253; cv=none; b=iaX0JU7Wp3gKUGNbqvTnzHrkgTMbSn0fSkSmj2nBo3kpuGwJCnMzGgWS0XwdjR+9Uug9IphTUkTx3b+zbm1etX9KyrZeU15SP9aFoISKrmsJdWqfcSe6s272vsuaQKcemULuVMrhNJYESEZ/km/P8P8qaea44HNdgxj+GBS0yqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763461253; c=relaxed/simple; bh=P9h23L8Gjyirwz1WWqMRg8hLEL6LvVGncng7nYkAaHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cPxCJZThwVrQIC+hjXFBiqwyoJpKu9oiVlBsnDfakQx4O3C2Sbrk7CR9+/tmrdkrGU4Iq6ysMaV5TbdH/kOzH9CZMNo/0ZSvDpc1hByY/9eGt2AXaBr2GjpTzQROHpxqxEcbeEpG0ur3pgqeRBtCWjQPtZvCPc/Ai0V40T/SSvU= 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=NgI4vLIi; arc=none smtp.client-ip=209.85.128.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="NgI4vLIi" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47118259fd8so39453665e9.3 for ; Tue, 18 Nov 2025 02:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763461246; x=1764066046; 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=k+89Qj7fu+1KrH8ZagotGare7OLOGg2NieZMi7MPs/Y=; b=NgI4vLIikUzr+DaZz5pAzpAVrwULCfoTgaEshosyO9JKZlQ2OxoLqvql/bKTfvLK3Q Xu9Et9DhEu0lCfLhO7SSWn2XtDPbctO3jvoF7d2d2iDrzR5pHzV/7Eokx1hzehqKHOlg SqEbcnfWzAkYmoyCfUWx0F+Gn27hlNOeDxEd5xfRrC8ZfjBrqrPjIL9crFcaXBCqq/Jv +t8mavchEr//jq4PiUv0HIbrPMqCwSc9lohFfwvg8WrsqTrr5DgGZ3AG2mW8pR+i0hds kdr1hjX06d/o/lBN0PFs67GRxAZivwZ4j/nLPekmL0znfL85MDdoky3xCqB9IJ7Be1vY WbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763461246; x=1764066046; 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=k+89Qj7fu+1KrH8ZagotGare7OLOGg2NieZMi7MPs/Y=; b=pjsOc9KDjv67aB1M0tp+/bDXRIGny4sRv4rSsonlaA7ONa4+L9cUym9hYmDjKXBYOe TvVfdr0XMSYPPBXwJbVtCKmOEp6ddj4EIoYcplLu3Y7+SumCB4lElqHyJmb2OA7gy86d t4PZlX1H9zYCNXwXXA3D/G9XMX+d9vttbMb7Pj31Hbydt17DtfsKIGjGDLMv20xUYtxf ghoxuONbPROQ6QMdt/MSIxeUPKQAfBfoyJgAhDammeLOv4N+n+FnbtHcq829qhVvgH/k t/OD9PFS5pEGTw63zak/XC2BOVp5XJz7aklxiwkm20zRFvvDKUJ960C7pTV913B+9UXP 3YCA== X-Gm-Message-State: AOJu0Yz2HfPF4PygdGLO8YwLR99Xlwxs+UfGSTgE93vs1r//DGx+VbkU Jb6iPCkpOAXRFWMOmDFarFVQgxoWV0CINWqPDQKLOY7xwODxJm30y+iLCoFEWHe49cY694PeSzq vw0HR X-Gm-Gg: ASbGncs0Ok32RN50KZztniYzdITdrat8KVBf+ArLQZsHp0M0WgNQk4OuqLIv+8p/vkX o3cCtqK6UiVqRjd0A3WH28kiPDgRm0XJ4IHDp2gYEG6NqlNxgEKqYgNUAl5vbTgs3+CTeg1tmh+ U1jWFFYKAP0kxb8PpS3rNkS3ReJ0As+UlCv/mz/mhcpHPYDj+8IgHfmNXMu4aRVZqw6H/tYoDas iwbP/8Etw8vx4mPEH6DkgA5ew0mxOPdKAGCjyxhrS9zKdbLaMOA2KNab4Q05QwhgC6nGTGwISh/ 7NkoG4o409ijzuzKNN1Q0IN0ocFRWfB0fsxCa9mUQtaP72LX5KAGB1gtjRX87islvE+j+0jXdO+ gvU6VPAh3IGUvBv2lZh1t7pg+WrW7nRR1XC9KNncmxb3IZRVSYc/WFxc9fudaE/FlOXPhgKRqNb WGKq5iVbu1fTWo+vreb/G6B7uPg8DZ+b2pDC0= X-Google-Smtp-Source: AGHT+IEoPjLdkXGBqQEWOVFXvzQzPT6ouTiGI6i6WvQ/jckcXno7Jc9xHz+oLweh79HpRRR9isjD0Q== X-Received: by 2002:a05:6000:4312:b0:429:66bf:1463 with SMTP id ffacd0b85a97d-42b59398ad7mr14607167f8f.44.1763461245786; Tue, 18 Nov 2025 02:20:45 -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:45 -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 1/2] wifi: rtlwifi: add WQ_UNBOUND to alloc_workqueue users Date: Tue, 18 Nov 2025 11:20:31 +0100 Message-ID: <20251118102032.54375-2-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: 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 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=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..09e5a16d7252 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_UNBOUND, 0, rtlpriv->cfg->name); if (!wq) return -ENOMEM; =20 --=20 2.51.1