From nobody Fri Dec 19 15:49:54 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 05A6E330D35 for ; Thu, 6 Nov 2025 14:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438812; cv=none; b=HaGKWSH/aM30tWWAXEB85TyA8u4A4kHXmuoQEznrOcK5cmLowkkxIsygTzwVw4dCT9FbdJ7gDdWQkF91YH3ow+omM9Ny+yJsxsJKFkhYWZMlCdmwUOBgnnZDN83+tDFgnvLMqoSWcWkKsAvSZkHaCWOJvmF2GeXd6u1YAbK/32Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438812; c=relaxed/simple; bh=L7FDkgspg8idJWLA2cOev6SpZ/+CA6hgRhvjcEZuen0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICN59Dv5thSUopZvoqyYe3IPrJILr2W8BOZgf1gEJL/bFVNXNrCtfuxGpFlwhSAHEEZWHhhjqmebPIa1u14nFEZbjf3fhgeRHHGcSZxizrvXvnhBF6a32qLs7+spCyb9/UEGhmwmPFJuvM8bAjuGMIvKq3KxWvzYc5nBlFrJzc0= 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=evjM1ED7; arc=none smtp.client-ip=209.85.221.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="evjM1ED7" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-429bcddad32so782207f8f.3 for ; Thu, 06 Nov 2025 06:20:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762438808; x=1763043608; 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=CSb/NpcULPsnZf31wjwvg0SCqpDq9sJbuWNdJIPEv9w=; b=evjM1ED7L9dqtlaafXhoTlIkcdBq2zax/QqTUKCoaUwBAIu2U8lIigI09bDELYRn4b qXzeTb/Ei7YnAMme6U5tut8ipJb/wsCMq6/gwo8feHyqUiWkqccynUQP1se71bFliUEM unHJtelFVEp7CsZwy6oQPcbWF4mZKf0oQ0i5pgyGaQMOn24sWUelxe9mJkiQmZPm5AYK 9Jd3Pn4iAluuxE6tHJrZiOkMRrMBmSDWkekySRpWoMqhxd75SzGKwzYa2dMcRGSXEsmX 77rDvXtNCqom3egS1K31UieTB/fvz0nQ7TJE/5s+qV3oBYo98t8m8DWij17G64PGTN/L vxAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762438808; x=1763043608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CSb/NpcULPsnZf31wjwvg0SCqpDq9sJbuWNdJIPEv9w=; b=FIi21MqUFsR7ACYCd0wpfpwr1739/Wkod9MDQEm7r3NZVnkvmjIiOgcTz5LJ2e4CuR H+212qTzEux1ruHCYWacn0O1nv0vJ6a7SlIU8ADrpdbLhLvSklpENJ8sc5qX5KfMFytP XRC3X4SBYjEK2HOh1DHhQflEKXGjxv/tGiLIDqHnsoXQ5Bww2tpzN555X08zQw6ba5JR O8WknsnY5jiNR1tlusv40V9lkbVeonhRameB1i9J9Qbx06Gj3TDz1ZhAW8onclr/B36z 2W0W83eZ8VvKv2OuHwDszU1OCR52Q++o5s9hYLHu2CaWzXeqXVfm9YiSW42jtf7gd7CT 4FTw== X-Gm-Message-State: AOJu0YyGqY+Ad2IFW6PdVcMnDyFkq24OMHVXAiUQGGDejXNCbX34dVXh Mo1Yk1JbIruVMwVgP+YAfI1uPx3UiAzBYoWL54zno4S+17QnJ4MFkm4D/9eoB3qy8fR9tI9jx6c B9EQQ X-Gm-Gg: ASbGncvTpCAKi13GkYTZCTrK0ON8xejjTjiIPXNJc2rLwbn/al9tEdheegci6XlF1mz 64GUUzTF03MKKFRvYyus+xEwL3JLLE9bEWzvdmwfrg7WYuZKjyduUqdqJkDoA42lAoQFOV4X4Js ZXk42GgJf0ViNwzceNl8bTgVWNwH4HjNDzVrU7ZJa5vGyVyuOJB2e+mEBmBcsa4qn/XSO6J0LP6 2vYsVbX3gNozQwNKSoc3WHrKJ5w1fai7zDjXG5WbjfslIB/J8GlPHmac+vQtgggnc30D00Hznx5 l36D11cjkiHO65P9ObslCrnOr61qC9X53SMX+0Ewl2qktxigr/lDGaRqh2zvoU5dK2HPxLx37l+ aaYRAEosRzf7y/CDQe/s/dwtVBGiqZNJNyyR7PHdDnaksczUOFZlnSTYWggC/KjKAHJpDxvCvOe 1voFHiwS9zKNmDyrB6HGR9cBo= X-Google-Smtp-Source: AGHT+IG8qhh+/UrI5Q6YrzncjND/C+ekwN38TtxEM1DW+cP8lXWnciboSuRATzLEsHz8zGksZ8qqxg== X-Received: by 2002:a05:6000:4014:b0:429:b1e4:1f79 with SMTP id ffacd0b85a97d-429e3340173mr6525520f8f.58.1762438807877; Thu, 06 Nov 2025 06:20:07 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb49be96sm5255531f8f.35.2025.11.06.06.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:20:07 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Dmitry Torokhov Subject: [PATCH v2 1/4] Input: gpio_keys - replace use of system_wq with system_dfl_wq Date: Thu, 6 Nov 2025 15:19:52 +0100 Message-ID: <20251106141955.218911-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251106141955.218911-1-marco.crivellari@suse.com> References: <20251106141955.218911-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" 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. This patch continues the effort to refactor worqueue APIs, which has begun with the change introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") This specific workload do not benefit from a per-cpu workqueue, so use the default unbound workqueue (system_dfl_wq) instead. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/input/keyboard/gpio_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gp= io_keys.c index f9db86da0818..5e875771a066 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -434,7 +434,7 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *de= v_id) ms_to_ktime(bdata->software_debounce), HRTIMER_MODE_REL); } else { - mod_delayed_work(system_wq, + mod_delayed_work(system_dfl_wq, &bdata->work, msecs_to_jiffies(bdata->software_debounce)); } --=20 2.51.1 From nobody Fri Dec 19 15:49:54 2025 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) (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 DC85132E6B0 for ; Thu, 6 Nov 2025 14:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438812; cv=none; b=Y01IZaEm6ctG/p5Pzz9MUtTkE+Ca5aHYuM64k3juiMp5Srq7SrlVDAFMkW/Pr0eO1D1xNZykVSZqlDc87mk+R7rAACm2NfuKd/b7DB5lNvBrVo62J5848/F26J6HMXyUiN3E2e9KOxBdoU2/HvPA7CDnqEG3aCp4V7J2KDzBO/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438812; c=relaxed/simple; bh=ne64ZMpOHv5JrJYTl+IV6blK6HhNvZS3fCmagvcA/EQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dz/mA0buls7GZwDZ1pDwft5ofCP8htGU+AAIji1cqrMBvuO/FdeNnhsuvfWb3JC4SCCothRVcDglK4xSLiB7DSpsfhLB0UdHgA5nrzz6f45HJ4Jp3+HD5MQZeqJOx+cGI06zD/Enejo25gMC/Y5UEZi5bAj02o5Hg2KAkkHGD1Q= 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=RwE0yhD/; arc=none smtp.client-ip=209.85.221.68 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="RwE0yhD/" Received: by mail-wr1-f68.google.com with SMTP id ffacd0b85a97d-429c82bf86bso735266f8f.1 for ; Thu, 06 Nov 2025 06:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762438809; x=1763043609; 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=Tvl0FaCGGvCd+ecMva35yR/ysW/rAFJwtlTSjqQndyw=; b=RwE0yhD/6m37I30+PO+KKv4HTSyQIHtfQT8Y1HoEga66NtvKriWwGH6P3lCFi0rgWW 9DkA3CVQQ8YWnmcWTeXeWhQtTQQUnncBxLJej9BnQKJ6NUg/aI+WONJqAOsGSXdBKXIw ykvMU6Fav6zOhksN8Ce5/P56jigXyP+U/kx7zuUCdh53UjcSZ26i9vxppU9RmbM1J1Zw Fj9iQGRhAT8t6bwR9EU2HktQgqzxyMgq7ZaDkndGcF7RxqdS+gZtsNifwOpvtEAmNEoj DkocOjbN97atvVuNSjMj9aod19QGk5e/W9yM1bh5A9yhKlvdeVQ08tGBcDgzmzilR2Ps 56/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762438809; x=1763043609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tvl0FaCGGvCd+ecMva35yR/ysW/rAFJwtlTSjqQndyw=; b=HaWCV6VhSzGYbmqgaH21ntfiYwiuBBEEk4Ej6WoMIVvoJx7DHg8gCuvU71Cnp5C5n5 zrAaoN8MS6zguXvhrTJgEEy7x9i1nbXNgsYwtHvudDjMWJUbFs8AOwNbK2XrFNNb6d3o 42uHmJmrARfbFxjEkDH/Ve717BRsyr1m2yAnRZzIaY0oMJvnLCDLmsETSk9Yl52VHm/f lHt5ss4ClBfyuyJKOHlbtwwvqrMYax6G951tegdwPhxX18t9J2PKFyCMI/4mGwEGcYIe 6YI+7BycAn3wxRrfaCs0MVaWXEoWgNbacyijL5d/6kP3lWpnRsfgxO/Ufe7jel2fGN/7 3w6g== X-Gm-Message-State: AOJu0YxXBpbLwXGV4HxI/e+3Mykj4roRwXONrXC5rJ8VqnsHTo8APUUh HB8F7MAOPI0G/moK1dXVT9lVnG4yWSSyJI5lOvXvA7sVHaaHwiUlYL3W3UL9WZeJT2+BRFmUNaC OhI0tELs= X-Gm-Gg: ASbGncuGl2DAAjd39EJ/eCfLQ7Xx2DiiKbKYOrkPKgVxnQ5o+SVQB5nSBTkYMhKgj2P RfsgVPsq25sdFcMNsfBg/Lqp0twuXgMhS0dsqiAwEv3dxqwU+Fh24qN5tH/Zzm5vQP4si+spPz+ t7WL3U4qS9b4CiMxTKMMPorr4QQoqa9Gxil6IgcgpRGSP8Zx8i+nEy4MGUDUNn7LQoQUcoorfgP xLlsgjCd94T9m0ZPcsz15jbJWEdpWyANeN0qxdX24hyv89+36VDdqXiD2D8mUG2n4hsfaAnjhYC Fr5oanQ6bUtX3hm1nRio4vxTwDE9PYAlna2SR584bYKaA8HjJhEjMIC7YHhOaeTAsxO0eU8ztNS czSKY6vdwdsnfhaSr3K8jdYDafmNz9dYKx/GZZt56gstVuDuyFgBFysVMyKeO1bO0KXppovOE5N 2VPZd28U7ZFdZ8etFy1pxn0IFCpLIvXI1DzA== X-Google-Smtp-Source: AGHT+IFl68/B9oFeZwFiwqtsa9uyiZlKZflUFx6d2HXKSbpyFcG05DLesWxzZYfX2T5uhbdPMVBT3g== X-Received: by 2002:a05:6000:22c3:b0:427:900:68ac with SMTP id ffacd0b85a97d-429e3305d0amr6567727f8f.39.1762438808852; Thu, 06 Nov 2025 06:20:08 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb49be96sm5255531f8f.35.2025.11.06.06.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:20:08 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Dmitry Torokhov Subject: [PATCH v2 2/4] Input: palmas-pwrbutton - replace use of system_wq with system_dfl_wq Date: Thu, 6 Nov 2025 15:19:53 +0100 Message-ID: <20251106141955.218911-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251106141955.218911-1-marco.crivellari@suse.com> References: <20251106141955.218911-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" 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. This patch continues the effort to refactor worqueue APIs, which has begun with the change introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") This specific workload do not benefit from a per-cpu workqueue, so use the default unbound workqueue (system_dfl_wq) instead. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/input/misc/palmas-pwrbutton.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/pal= mas-pwrbutton.c index 39fc451c56e9..d9c5aae143dc 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -91,7 +91,7 @@ static irqreturn_t pwron_irq(int irq, void *palmas_pwron) pm_wakeup_event(input_dev->dev.parent, 0); input_sync(input_dev); =20 - mod_delayed_work(system_wq, &pwron->input_work, + mod_delayed_work(system_dfl_wq, &pwron->input_work, msecs_to_jiffies(PALMAS_PWR_KEY_Q_TIME_MS)); =20 return IRQ_HANDLED; --=20 2.51.1 From nobody Fri Dec 19 15:49:54 2025 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 C43AE32E6B5 for ; Thu, 6 Nov 2025 14:20: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=1762438813; cv=none; b=P8em+CSvXEHCTkCs+K2z1M0FjjFigCTznD72SAzlo99t5lq2MoKU35x4ZwG7QMlrloTgU4rjY1YaPmRFpLWp35DW+8Rxc1dfdj/VMRUd+RP8Hdfv2fCe3a57bWyS4AwVR6mjVto3R6Ap03Gegd9FolJ3n2vb/HKhzWST7nTUoqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438813; c=relaxed/simple; bh=iGbdNz4zRjPt2GiUJulnVuYyuGFHGYnl5Zn/KzkGIU4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JOnIg7neS11ocSewmWwbThdedS/sU3beYOjkLdBwdfJ8qm9VTtKLR6f49krxSSQNVdNNHiqipm0KVtBPg6b6JUIFCFHeOdOTXH14ngnocGIqoPPFlFySEuyKJynxWgGRgVvIASCvK9kBN1eIwxwCTirfbooo7uX24RTXZdrLfQg= 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=LtW6TchX; 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="LtW6TchX" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4775638d819so5269315e9.1 for ; Thu, 06 Nov 2025 06:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762438810; x=1763043610; 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=CF/3Zhb7QddI6EQtUEi+uCpLAFeiI4pZCmj4H7qhD5E=; b=LtW6TchXO72WjI5DsqGn2Y5jDMVWSdXzJZTz/DK3swKMpGXA59GzcvcDlJ5Q/IGd+V Nat/JqzsRkIO9iLhnuyZmTkvDvqQY0FtSBOXR8zZ6PvWa1M6mPti9IYn+fXsnqg6s6XS HWTKJKFynr2WOuZlomrulBf3CZaKR2itWH1kDqOQfuULtTKZqJ5cDZ6VuZMgris2MoWV BfoW+mKsI/bpwheGMjrn6URiHCFxwzl36YVx8+I/KGZdi3pEax1QtROS/1ZG3BFUm8je YtZbKqnOla3N9dbf3gyM4dQZ8Wf9ZOT0DxV1n3srqhvfZvtTrR3/G8d/LkgizPBmYtUu RQwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762438810; x=1763043610; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CF/3Zhb7QddI6EQtUEi+uCpLAFeiI4pZCmj4H7qhD5E=; b=NbRNv/VhjvhxWkqRr9LXBA3O+Mp0B5IyIMbNojMENE9f1fMU78lrF5z16b1ZMcBJU9 LXFOMHcxNAG7mBw7LlOv/9jwhLzPA+gufMfunEKJ8Mklgkyt3AsOVB/ZDpYqPfIOGhWt 7CoJ28MZIl3LFQ1q1OSqIVEZdmk5Nl1/JgYCkV9cEgsf6kdqi0OzcbAGpGPaXetavMWT ftmOm4cdv+gwUR/b1QAoWS7weh5OKYOOkuGwbFxbf6n48XM7Msy54zc8y7rwQ7Tc8W2F 5v/Dn94URcwDWLRlsbo/6XyMdBxvi1jihiC9kxzA7s/raq9ckvUuVQl5BeSgdNC1qomJ WVRw== X-Gm-Message-State: AOJu0Yxfp+KP5hK1u/vmY0PrzbUCj2VNIBGkZXC7GkwpB1BPkwhDPEjh KpLZQNkPRpZ+xZa0B0vw5Fa6vtPwZ/3srWIAlOyvPKMBXFCZJyelL6ghqGSvOKgolZCCSV0KF/4 dQsfl X-Gm-Gg: ASbGncsp/wk83KCG7um3TV/nZK+IpPVSNZVRPzQG5bHT5UTBtXiu04QjGromfnL9CLO 2eJdFoVV9qNGGbiQ4myiNlvOyCZJxt0Jt/IcrDZ/GKBFTg8xFOIY1hlAnPsD4BYLjYu+5EWL4Fk VoEhXXW0GKw/xYObgDD4BEgCgvSvnIni8lCgnaD38pcxa90BGcm59I24Y04vgn9OON5aCY/S63N b4j3HQN0i8GHNysUxslBPpgAm0c6ich4SOTAvGcc1CkDOr8FW65OXxD6yG/9CjVjxj6Vm6B/O8M X/RpIJXsTrCQfrjaZeDXSee4fNaal5Sf3QdKwnV2+lr1UzufIGAQvAExlfr6KxF+A6tlkOGB7rl oCtzplp+/kstSYvF484U6GRzDw5xuWeM5KXAsrKa5etgmFOKLij82utLX6yHhy5+okUe2n6LzsZ KGJ7gXR30hVRutAQpLv8cRqB7IRG2SQ1BhmQ== X-Google-Smtp-Source: AGHT+IFW+O/CoCb7xED6y+Ltl4gz0/OdvbxqMSNnvVU72mzUQf/s26b2ifVZCIL+FfdWgyI3Eah13w== X-Received: by 2002:a05:600c:1e1d:b0:477:a9e:859a with SMTP id 5b1f17b1804b1-4775cdf54e7mr65221865e9.22.1762438809722; Thu, 06 Nov 2025 06:20:09 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb49be96sm5255531f8f.35.2025.11.06.06.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:20:09 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Dmitry Torokhov Subject: [PATCH v2 3/4] Input: mouse - replace use of system_wq with system_dfl_wq Date: Thu, 6 Nov 2025 15:19:54 +0100 Message-ID: <20251106141955.218911-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251106141955.218911-1-marco.crivellari@suse.com> References: <20251106141955.218911-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" 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. This patch continues the effort to refactor worqueue APIs, which has begun with the change introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") This specific workload do not benefit from a per-cpu workqueue, so use the default unbound workqueue (system_dfl_wq) instead. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/input/mouse/synaptics_i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/syna= ptics_i2c.c index a0d707e47d93..c8ddfff2605f 100644 --- a/drivers/input/mouse/synaptics_i2c.c +++ b/drivers/input/mouse/synaptics_i2c.c @@ -372,7 +372,7 @@ static irqreturn_t synaptics_i2c_irq(int irq, void *dev= _id) { struct synaptics_i2c *touch =3D dev_id; =20 - mod_delayed_work(system_wq, &touch->dwork, 0); + mod_delayed_work(system_dfl_wq, &touch->dwork, 0); =20 return IRQ_HANDLED; } @@ -448,7 +448,7 @@ static void synaptics_i2c_work_handler(struct work_stru= ct *work) * We poll the device once in THREAD_IRQ_SLEEP_SECS and * if error is detected, we try to reset and reconfigure the touchpad. */ - mod_delayed_work(system_wq, &touch->dwork, delay); + mod_delayed_work(system_dfl_wq, &touch->dwork, delay); } =20 static int synaptics_i2c_open(struct input_dev *input) @@ -461,7 +461,7 @@ static int synaptics_i2c_open(struct input_dev *input) return ret; =20 if (polling_req) - mod_delayed_work(system_wq, &touch->dwork, + mod_delayed_work(system_dfl_wq, &touch->dwork, msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); =20 return 0; @@ -620,7 +620,7 @@ static int synaptics_i2c_resume(struct device *dev) if (ret) return ret; =20 - mod_delayed_work(system_wq, &touch->dwork, + mod_delayed_work(system_dfl_wq, &touch->dwork, msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); =20 return 0; --=20 2.51.1 From nobody Fri Dec 19 15:49:54 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 B4B423446AF for ; Thu, 6 Nov 2025 14:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438814; cv=none; b=rFdnfpHBaYWmgF9bTP707sgg4txtHFmjZWiJlaK8sc91s4Hvia4E8E74y0bnZaLvva57Iz4wlNYy0baS0C+bf5XKhhM73E7mZvYzgjq2HiK91KMwQWMkqBpuf+MbfbzvZePAlk2xB+5Odz+WR6osHsvbalGu3OGVhUO7MZrxHg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762438814; c=relaxed/simple; bh=8NtqKplCTfthbw1sz5U+vy8cTC2ogSC3rGwhwWFmRQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lnvmuqkgZO8FhYDapBamGWSA0gX/pTfZpabU0CzLJNcyjwT5DOV80I4VMYxHN/xx2EWNPENVsBDPfLKZMqTpf0AEwbHJyQ5SyUxpGLfEdni/xooWehP6SArmkVTlrFmsM/cDANVMp2l1eOy6JL49jtN/5JokILuhTlwCNJe8hIc= 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=C8/g835m; arc=none smtp.client-ip=209.85.128.50 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="C8/g835m" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4710683a644so7429345e9.0 for ; Thu, 06 Nov 2025 06:20:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762438811; x=1763043611; 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=2TBiyXlV6SP766DuHM6j5JQotvSVYeIR5ytAqVLqwpw=; b=C8/g835mP4RC0PgZ+b6KETu9P7Mh0hIfJ9QrF8oXJZ4t5uKJ4sZK3mtSreEblixSLu EIuaGa+QLQ7KK7AMs2hbb/o1koNQRvoIDxgMUEIcVZ8s4Z1w4UbBy3K0oV6MpNW06KcQ I7WV9MGJV6f7RlMihn41RtWReHgaOXQkkS3btHG6j8BnS/rpSNgIQYASLFZA3THOjznN 9qqIa3C5jbShbGB2tuy1NKeDTMHYKQ9zCQIz7paeHMWF+lsy9QV/ZyswXLxA18zAYlER CDsO+f60mp41NPg3oYP14nENf3hrCpcc5d1YReTf4cBeKyHLYwz3J81AjxxE9BZcittR iCwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762438811; x=1763043611; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2TBiyXlV6SP766DuHM6j5JQotvSVYeIR5ytAqVLqwpw=; b=PYMfZnuHSFIaywob2UihT7X7xTDxhECvw2UovDNMrR14lBxD7+GETzq+s65t3PUI4g FikuNnqfRfiou4t/prDbb2atW1bowmp8Dai72uaOPY8wQX0Vo0wMQRmJpXF3YLtZXcNG oeoVTYEuesWRcVWk4Qfxl3KSk6EFL/7U+OOF01qytUKCnd86zAijOJk4BRME2fBQjn66 NIzp4r+fugz83JQNvi3VRXbOOPnE1SfEVBTBu9f3d/Kzgfpb625R61TWsXMRN1ekDKxs 7q0Dk4yH6df3SCG055YU4ELMT/aLlKoXF5RjNrtevMVRaCVvyOz/mWc2p6YxasvGNvsg lpSw== X-Gm-Message-State: AOJu0YyZkibyKTeB1fOxj7eebRX3FzrytmLFbzHk2eTqGejhPMX5dFFe X2V6+WCUhOGVvo60vfJpBoTYKsQBhmTdV8RGxD8aX229AZKy/Du/+1vCSAU7IRBhguDysZGftjs mZLaM X-Gm-Gg: ASbGncuxHyuOhmh6nMBVKLOchmL8PPH2lcUFOrJ8aidROXbmFptjg9qbkSeRdIXYsp5 TI5rSccCcHYONRkr/iD3n3C3uDyNrjEemiaVEXqVaILNti4QyZ6da8aQKymw7Uj6qukRtYwfTKL DUYrq/b1ZEvt4lu2DimMK/dMfgjZTCBZQbezxT0C8H8clwi2WWKIZxMoSXQiKisefHYXdVbrZS7 /8QO/nHWuy1kICK9zOCDrAoQoZfwsUwpJ78CRrY3IlBAC3T85+R9mxrT2lUQXRkOPt+GLak6+Nt ht51MGzYrk6VUh0/UjzRcovHg++rAIfVsx02FeRRIhATuw0ndzJRGIt9QQD5lxl7uddLY4GN3wS Fc4NlHhQ9KLSzuYTwrbneRMnYoEZg8IewGFFFe0YfrozldhCYP3zmTGIvYlQgF60dA7gyHI4Fc5 SFVGkYhv2+AdQbA4q6QdK0yhM= X-Google-Smtp-Source: AGHT+IEkUdUSnfE11zagsJf8KjzZv5gAOKwiUUPQtcQqvGlegNskiK6BvaOrq9+/jCOzm/1zxdPqiQ== X-Received: by 2002:a05:600c:4e86:b0:46e:2815:8568 with SMTP id 5b1f17b1804b1-47762049f4emr29994945e9.10.1762438810682; Thu, 06 Nov 2025 06:20:10 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429eb49be96sm5255531f8f.35.2025.11.06.06.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Nov 2025 06:20:10 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Dmitry Torokhov Subject: [PATCH v2 4/4] Input: psmouse-smbus - add WQ_UNBOUND to alloc_workqueue user Date: Thu, 6 Nov 2025 15:19:55 +0100 Message-ID: <20251106141955.218911-5-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251106141955.218911-1-marco.crivellari@suse.com> References: <20251106141955.218911-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 enqueue 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 consistentcy cannot be addressed without refactoring the API. 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 patch continues the effort to refactor worqueue APIs, which has begun with the change introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") This specific workload do not benefit from a per-cpu workqueue, so use WQ_UNBOUND on the custom workqueue instead. 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 --- drivers/input/mouse/psmouse-smbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmo= use-smbus.c index 93420f07b7d0..15bd49ccad22 100644 --- a/drivers/input/mouse/psmouse-smbus.c +++ b/drivers/input/mouse/psmouse-smbus.c @@ -299,7 +299,7 @@ int __init psmouse_smbus_module_init(void) { int error; =20 - psmouse_smbus_wq =3D alloc_workqueue("psmouse-smbus", 0, 0); + psmouse_smbus_wq =3D alloc_workqueue("psmouse-smbus", WQ_UNBOUND, 0); if (!psmouse_smbus_wq) return -ENOMEM; =20 --=20 2.51.1