From nobody Sat Jun 13 20:22:31 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 BD47548B39C for ; Tue, 5 May 2026 16:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997833; cv=none; b=jB7n2MKKffzbdU2aj2oF2vWuT3fw+nV4iV/Zf4IqsULSMKq6Mnu/F7sweg4OWcjWcvSg1EwsMXf43jkxwrvMQ3oopC1G++BQ5rVXfidJ/c+ry+0b/XnU3mES9BhI1plATcEID2YFyscfPyWuJ0dq4PTMV497s52vPX4MTU2nauw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997833; c=relaxed/simple; bh=TsjoLpftOlmCReXNo/31yHGBU/QQivOUvXmaAIgsJyA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j+iu0xDV4R6XH9sY+N3r+1RoP8v+Z9HJ5jge599+ao3xpq6a33CdRfsZjifRDd6N8vJBLG2QANxPiLzK6YLCwZ+CmT80/fVG7qQAaauBu6uvvMAa83OWQZWiEM2h/bYuVNPOEAMATDwN0mU0XW45rGlzd+PW2NeUH+I/P8DKDks= 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=CLSSJjoD; arc=none smtp.client-ip=209.85.128.49 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="CLSSJjoD" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so69938275e9.0 for ; Tue, 05 May 2026 09:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777997827; x=1778602627; 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=rrZBpnoMhTbPRSObL2aN+Mos9NA0W/DcBKq63dAp7SE=; b=CLSSJjoDLzjoFMjDM3Be+J+PWA70U8xpQsa6ONd6z3uP2y6PS6jstxd+urHmnm/ffs udtBgWvo0iFhTJdnlsuqh8FaIYrQbG4c2eNt7BkxHiBj71nRZI9WgK8UMaDSCPS10ZmU ZFiim0GRvMcAeZHZERMN0U6aand9hFXNz/D+A5O10RwL1CT3a5dMG/31KJVOrpi+58oX VM9elQ1kzPnsON7XygSVzTUpIDxklKCiyLMh1mpTudolTZumc+4U49igKJyf5lFZxLPz V5nkipK+h6V4fRqML0/1NwGlOdf8csLZlRY5vx7YxIqRZbo5d11oAq4gt22XvJwRsuF5 0HvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777997827; x=1778602627; 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=rrZBpnoMhTbPRSObL2aN+Mos9NA0W/DcBKq63dAp7SE=; b=fNAfjXeKMV88zYRYEkDn/oDRX3IBfuqMBlnp49tJm6N5+aCYUlNulhs1h5am59N5cE ZjIDpSk+YJlesZs5jlAjPTXZNpTDfiGSs3phGc1jzgA/WtaY/mF5vtHn1YVEf3nE3jCp +/i3Ox0I5o821vRoIlN7ToFmVABAsZuB9xirf5hVWWNiu1OcqRTayJLtykOhwm5rEsMC zhkAqyoXMK7AO+Dz/cnkr/ywilPUlRABcOvLAAszXIUMNzMuqSEAI/ZMy7Aeb5z2qy1P hSRkzZ0iKdiB6e5K52+hyWQt99N2kBFmQ1slwr2/hlx3FCq+GvhdsmUFe9XjJwBNg95A CnGQ== X-Gm-Message-State: AOJu0YzsolDvaPFsOqIaoZQ43TPdyHJmNURn8klUcGgpocN8FIS4O0S9 1mOY9AdeQiflKcQTJSYiQawqaDvDjwovbBZ+5kwZZxExeKtnbJdTNqU6dFFBes7SO84oAO3lT8J FL9Gqwak= X-Gm-Gg: AeBDieuEBwZqjhFJtskoMSb2FmRd4Yh+L0PoVXLrPqpO1f0Fj6Uh/y80istxvYNj7ca z891ekthFU7hFkmp/UiXXelQe5S8cpH0J3tdFq7komBf3toqlbwwn4Tp7E0hNlnWG/503VPet3h +nv/68zyNxwswrXQxHLF4Q0Y/04bmzx/Tg1fSqFupWbfikBWpxPIzsQL8aVouH8qN4bCc0pMyd0 EUD5tWU2YxRBHYaqyTDY3swk24pKRZKSkll+rLefi68qsa1ftrITTuuy7bGXAflq1s8Oq7T42TB N0f9IjFT5PBhLUeKqhevUWzxojYJYOympgpoUvbnv1Yco7QlXnmEl1RbktJP482jufJX+c60Utg i61dSpMpiA+O0AIRhuKMCdJH9D7BB2haQir9aeDTbS9iKFp5ODtFWJCaLmyKpLZaQ3DdeRCqKa0 7vpKkht40+A5A1O9iGN7JsngDNGJ3RxfqhrJm0TXKfZb9t+tHUTQL1y6mCOknb0cvZU9Fp X-Received: by 2002:a05:600c:8b04:b0:485:40db:d40c with SMTP id 5b1f17b1804b1-48a9852f332mr237936985e9.3.1777997827128; Tue, 05 May 2026 09:17:07 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a82301adesm400997535e9.10.2026.05.05.09.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 09:17:06 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko Subject: [RFC PATCH 1/2] workqueue: Add queue_*() functions, future schedule_*() replacement Date: Tue, 5 May 2026 18:16:57 +0200 Message-ID: <20260505161658.401998-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260505161658.401998-1-marco.crivellari@suse.com> 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is part of the workqueue refactoring. More details can be found at the Link below. The acqual schedule_*() interface used to schedule work items on a workqueue doesn't distinguish between bound and unbound workqueue but only system_percpu_wq is used. So introduce the bound and unbound versions. To better reflect what these function does, rename them with a cleaner and unified interface dropping the "schedule_*()" prefix and using "queue_*()". This change introduce: - queue_{bound|unbound}_work() with the bound version being the future replacement of schedule_work() - queue_bound_work_on() as future replacement of schedule_work_on() - queue_bound_delayed_work() as future replacement of schedule_delayed_work() - add queue_unbound_delayed_work() to offer the unbound version - queue_bound_delayed_work_on() as future replacement of schedule_delayed_work_on() A further step would be the conversion of all the users to the new introduced interfaces and the migration, whether locality is not strictly required, to the unbound version. In a future relase cycle and once users are migrated, the schedule_*() interface will be removed. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- include/linux/workqueue.h | 101 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index ab6cb70ca1a5..f46379d937c9 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -732,12 +732,26 @@ static inline bool mod_delayed_work(struct workqueue_= struct *wq, * @work: job to be done * * This puts a job on a specific cpu + * + * Note: this function will be replaced by queue_bound_work_on() */ static inline bool schedule_work_on(int cpu, struct work_struct *work) { return queue_work_on(cpu, system_percpu_wq, work); } =20 +/** + * queue_bound_work_on - put work task on a specific cpu + * @cpu: cpu to put the work task on + * @work: job to be done + * + * This puts a job on a specific cpu + */ +static inline bool queue_bound_work_on(int cpu, struct work_struct *work) +{ + return queue_work_on(cpu, system_percpu_wq, work); +} + /** * schedule_work - put work task in per-CPU workqueue * @work: job to be done @@ -751,12 +765,53 @@ static inline bool schedule_work_on(int cpu, struct w= ork_struct *work) * * Shares the same memory-ordering properties of queue_work(), cf. the * DocBook header of queue_work(). + * + * Note: this function will be removed in future, use schedule_{bound|unbo= und}_work() + * instead. */ static inline bool schedule_work(struct work_struct *work) { return queue_work(system_percpu_wq, work); } =20 +/** + * queue_bound_work - put work task in per-CPU workqueue + * @work: job to be done + * + * Returns %false if @work was already on the system per-CPU workqueue and + * %true otherwise. + * + * This puts a job in the system per-CPU workqueue if it was not already + * queued and leaves it in the same position on the system per-CPU + * workqueue otherwise. + * + * Shares the same memory-ordering properties of queue_work(), cf. the + * DocBook header of queue_work(). + */ +static inline bool queue_bound_work(struct work_struct *work) +{ + return queue_work(system_percpu_wq, work); +} + +/** + * queue_unbound_work - put work task in unbound workqueue + * @work: job to be done + * + * Returns %false if @work was already on the system unbound workqueue and + * %true otherwise. + * + * This puts a job in the system unbound workqueue if it was not already + * queued and leaves it in the same position on the system unbound + * workqueue otherwise. + * + * Shares the same memory-ordering properties of queue_work(), cf. the + * DocBook header of queue_work(). + */ +static inline bool queue_unbound_work(struct work_struct *work) +{ + return queue_work(system_dfl_wq, work); +} + /** * enable_and_queue_work - Enable and queue a work item on a specific work= queue * @wq: The target workqueue @@ -832,6 +887,9 @@ extern void __warn_flushing_systemwide_wq(void) * * After waiting for a given time this puts a job in the system per-CPU * workqueue on the specified CPU. + * + * Note: this function will be removed. Please use queue_delayed_bound_wor= k_on() + * instead */ static inline bool schedule_delayed_work_on(int cpu, struct delayed_work *= dwork, unsigned long delay) @@ -839,6 +897,21 @@ static inline bool schedule_delayed_work_on(int cpu, s= truct delayed_work *dwork, return queue_delayed_work_on(cpu, system_percpu_wq, dwork, delay); } =20 +/** + * queue_delayed_bound_work_on - queue work in per-CPU workqueue on CPU af= ter delay + * @cpu: cpu to use + * @dwork: job to be done + * @delay: number of jiffies to wait + * + * After waiting for a given time this puts a job in the system per-CPU + * workqueue on the specified CPU. + */ +static inline bool queue_delayed_bound_work_on(int cpu, struct delayed_wor= k *dwork, + unsigned long delay) +{ + return queue_delayed_work_on(cpu, system_percpu_wq, dwork, delay); +} + /** * schedule_delayed_work - put work task in per-CPU workqueue after delay * @dwork: job to be done @@ -853,6 +926,34 @@ static inline bool schedule_delayed_work(struct delaye= d_work *dwork, return queue_delayed_work(system_percpu_wq, dwork, delay); } =20 +/** + * queue_delayed_bound_work - put work task in per-CPU workqueue after del= ay + * @dwork: job to be done + * @delay: number of jiffies to wait or 0 for immediate execution + * + * After waiting for a given time this puts a job in the system per-CPU + * workqueue. + */ +static inline bool queue_delayed_bound_work(struct delayed_work *dwork, + unsigned long delay) +{ + return queue_delayed_work(system_percpu_wq, dwork, delay); +} + +/** + * queue_delayed_unbound_work - put work task in unbound workqueue after d= elay + * @dwork: job to be done + * @delay: number of jiffies to wait or 0 for immediate execution + * + * After waiting for a given time this puts a job in the system unbound + * workqueue. + */ +static inline bool queue_delayed_unbound_work(struct delayed_work *dwork, + unsigned long delay) +{ + return queue_delayed_work(system_dfl_wq, dwork, delay); +} + #ifndef CONFIG_SMP static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg) { --=20 2.53.0 From nobody Sat Jun 13 20:22:31 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 7944248B381 for ; Tue, 5 May 2026 16:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997834; cv=none; b=VUP7V5DHf52gAGa4M7FhLW3HWmLqosBr87o8Y9mt7wr1hoshNw8N+A0/ZFlpV54yZoPQf0Ani6rG40W+are9g7vffc3E98HtHj2WGnxlMgq/F90axbTVf9WFr6i3jamdGnmfskMSl/qgv3lpO0qPoWKXySC1bjcmLxWFDG9DbQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777997834; c=relaxed/simple; bh=Y8t6evXuiYIEPgBAMbdxb4luVE7UVXeswhOFsG8e/dY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W2iJitO/C6aLStAJ1sreYW1uwgUlHE6YFFztohcQUfpGaArR63g2+Tatk3Qhva8/O0r+ZAiEdiTQGM/2g21rmJdaxopt1MsgqodOk5Fd6zkCwKqmc0HiJVINOLUp6q0Akv5QI4op+sHQDqPmoBjyD/dkaxecaDTmBy649vttCQk= 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=CZlJc+Xt; arc=none smtp.client-ip=209.85.128.48 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="CZlJc+Xt" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-488b0046078so47454205e9.1 for ; Tue, 05 May 2026 09:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777997828; x=1778602628; 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=9hBwLPBEABIssiJEAR9YdFBTOOOzaUf1al7knzdrrA0=; b=CZlJc+XtxcFgixdfUnazDdk7JkTQELir7c24f+EMylSgj4ox3rpTQww3Sz4lCp42sL SsCtry2jH33iPmSJIKbNGCBx4ZAwpdKM+tk7KdP+yMuommy8In0hTzNXhT2BuuiZC/Nk zZN4cb5hE0yxphCKPrgMKfiEineCffycCvkNu/OtZO8wbkmBftn/zRO4/ySp3IQXRAYq 0C8jbcXhqbDo179GuiV+my8azOd9obkfZnM42gJPrMXaFPye3E4YzipMm/6y9O30SPz7 Ex7Iur3kmg8lsvpWdF85Vu+c83dhXFEyabGyjoASraQwpnR14FCyoaXaYKqdoY4dNqtt 5jpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777997828; x=1778602628; 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=9hBwLPBEABIssiJEAR9YdFBTOOOzaUf1al7knzdrrA0=; b=hK+g9OHSsQkS3O618/Lf58FT8/rDaYh4tKE8sVeZjzH5589HRAR+N0PV9yTN3TbQ8+ cs8YGZeUGUm7eHHfdutVUvuk9G3Bjt6BxnW+6EIbQRYPHX/q23F91zm6+Ilk8s+Huicz XSM/zcQNz2cvWSBosFuXqsGd2W2hxDBrjEDlnJnxgscMZTF/Y3vwU0SiYs/k7w1F4ySH Qg6ouyd4o/q6J8pmvgI6H10vR6JIVoCooEvQmbhWZPXOiGKEX8qHiZLvAWjyZ8unQUwL Jnyn340taQqM/Dwosc/V6HCAwQcD6YjriOQHR5xX4cLsRvFz72eXj0mybaD6tCqi4jv/ ukgA== X-Gm-Message-State: AOJu0Yy8lMAxMbh3CQPPH30CepTkhoZGe9s1Jh28OjNnwlsXvNRh8Iwk TDQ9OfmP/bn0YSaB5/lQD9eXiTjqL3/VVleCJiwTnwp6Rc8dAZcL2GrVEyw+DAVfWUCWfcsTbXw v1aiI0zM= X-Gm-Gg: AeBDievD0cx5HxBMYiGAGS8VAB/gycSXHkMI6tQegMcix+wnojzYnF2Y3oAL21R3P5A RWrVBCuAyw8vvlPGi6R92ejmYQg/3xPu2LhNz46lPOxUDjjOO+hb3TwG9ZyYJHyEdc2AU+zrGTb wzArr+ZqQFHrkIVTlQa8v93taQ4hygwvjz8+s3pzuKlk3iSGmulDLk0HCBGLsC2qDbGlVp7yeT1 N9mR7T5PVXbqYSVAOi64Jlxl9sqV2ZYGHm7le7V8CJ0jS4/GeVjiuF29kZOEY6nPJ3HPkeKs9om hDvEuxD9wkKp4YCP/2u7Yerb9H0KEn5oH0hsntxdYjSX26FlOUGHH1lwSlzQyPUVWxGOXT4V+Gb KkcGMf1uPxff4iTltB0jlBTam1zvfBJgK540a/QkNMCaZ1Wl//Wx3zjHbiRFh+qKO4wIrWro3Ll sW5jYQhbptvF66ONi4g1acoHreOPV3swS6eacSPG+ossvRQvgC+cL/NjKaxcgCeuRDguM0 X-Received: by 2002:a05:600c:530c:b0:488:c744:49b with SMTP id 5b1f17b1804b1-48d107465a9mr126160025e9.7.1777997828337; Tue, 05 May 2026 09:17:08 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a82301adesm400997535e9.10.2026.05.05.09.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 09:17:07 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko Subject: [RFC PATCH 2/2] workqueue: Add WQ_PREFER_PERCPU and system_prefer_percpu_wq Date: Tue, 5 May 2026 18:16:58 +0200 Message-ID: <20260505161658.401998-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260505161658.401998-1-marco.crivellari@suse.com> 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There may be situations where local execution is not strictly needed for correctness, but it is preferred for performance gains. The Workqueue API currently do not distinguish between these two instances. So add WQ_PREFER_PERCPU and system_prefer_percpu_wq, so that it would be the first choice for workload who don't strictly need local execution for correctness but only to maintain locality. Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/ Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- include/linux/workqueue.h | 7 +++++++ kernel/workqueue.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index f46379d937c9..be65df3dea5b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -404,6 +404,7 @@ enum wq_flags { */ WQ_POWER_EFFICIENT =3D 1 << 7, WQ_PERCPU =3D 1 << 8, /* bound to a specific cpu */ + WQ_PREFER_PERCPU =3D 1 << 9, /* prefer local cpu, but it doesn't require = it */ =20 __WQ_DESTROYING =3D 1 << 15, /* internal: workqueue is destroying */ __WQ_DRAINING =3D 1 << 16, /* internal: workqueue is draining */ @@ -460,6 +461,9 @@ enum wq_consts { * * system_bh[_highpri]_wq are convenience interface to softirq. BH work it= ems * are executed in the queueing CPU's BH context in the queueing order. + * + * system_prefer_percpu_wq is for work items which prefer to be local but + * doesn't require it */ extern struct workqueue_struct *system_wq; /* use system_percpu_wq, this w= ill be removed */ extern struct workqueue_struct *system_percpu_wq; @@ -473,6 +477,7 @@ extern struct workqueue_struct *system_freezable_power_= efficient_wq; extern struct workqueue_struct *system_bh_wq; extern struct workqueue_struct *system_bh_highpri_wq; extern struct workqueue_struct *system_dfl_long_wq; +extern struct workqueue_struct *system_prefer_percpu_wq; =20 void workqueue_softirq_action(bool highpri); void workqueue_softirq_dead(unsigned int cpu); @@ -873,6 +878,8 @@ extern void __warn_flushing_systemwide_wq(void) _wq =3D=3D system_freezable_wq) || \ (__builtin_constant_p(_wq =3D=3D system_power_efficient_wq) && \ _wq =3D=3D system_power_efficient_wq) || \ + (__builtin_constant_p(_wq =3D=3D system_prefer_percpu_wq) && \ + _wq =3D=3D system_prefer_percpu_wq) || \ (__builtin_constant_p(_wq =3D=3D system_freezable_power_efficient_wq)= && \ _wq =3D=3D system_freezable_power_efficient_wq)) \ __warn_flushing_systemwide_wq(); \ diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 5f747f241a5f..abba222a2d58 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -545,6 +545,8 @@ struct workqueue_struct *system_bh_highpri_wq; EXPORT_SYMBOL_GPL(system_bh_highpri_wq); struct workqueue_struct *system_dfl_long_wq __ro_after_init; EXPORT_SYMBOL_GPL(system_dfl_long_wq); +struct workqueue_struct *system_prefer_percpu_wq __ro_after_init; +EXPORT_SYMBOL_GPL(system_prefer_percpu_wq); =20 static int worker_thread(void *__worker); static void workqueue_sysfs_unregister(struct workqueue_struct *wq); @@ -8029,11 +8031,13 @@ void __init workqueue_init_early(void) system_bh_highpri_wq =3D alloc_workqueue("events_bh_highpri", WQ_BH | WQ_HIGHPRI | WQ_PERCPU, 0); system_dfl_long_wq =3D alloc_workqueue("events_dfl_long", WQ_UNBOUND, WQ_= MAX_ACTIVE); + system_prefer_percpu_wq =3D alloc_workqueue("events_prefer_percpu", WQ_PR= EFER_PERCPU, 0); BUG_ON(!system_wq || !system_percpu_wq|| !system_highpri_wq || !system_lo= ng_wq || !system_unbound_wq || !system_freezable_wq || !system_dfl_wq || !system_power_efficient_wq || !system_freezable_power_efficient_wq || - !system_bh_wq || !system_bh_highpri_wq || !system_dfl_long_wq); + !system_bh_wq || !system_bh_highpri_wq || !system_dfl_long_wq || + !system_prefer_percpu_wq); } =20 static void __init wq_cpu_intensive_thresh_init(void) --=20 2.53.0