From nobody Fri Dec 19 12:46:26 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 C24B62DC357 for ; Wed, 5 Nov 2025 10:35:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338934; cv=none; b=cYnB1t5NQF31roTTcnIUPsbMh2+ltlD+tFP4uLIvm7MkBFrF7/nnS++EM9PKEayfuZvddkR5IkGQaEEJJXeuJE5+TxICygGjcH0/3S6PLQCniABvMC9PpiC/ZEDkoYVx77vG6MVLAzGatRqYw9e14sh2UbNpfyP+g8JeN4GvYgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338934; c=relaxed/simple; bh=rjKKQg8702Z/q15UoUyi9h1Tzgen7J1IoN9fhR4y/tM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B5LElOa9Uum2lZQF0DGLyVNFxqwRj4OC2u7cUoFYbI9ZWL9M/lkRJ46AXoJscysqaT7hCzccrQIy2c4hohLde6ltD9o6A2fuOT0dYIDFoS6B3PH7K0dYXCtj9CCm42rgirqeRfNO37mJbxcNgs2nKyo447PmgTQZARtVGJtRRrw= 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=JzHS0hhq; arc=none smtp.client-ip=209.85.221.54 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="JzHS0hhq" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-429c7e0282dso3591498f8f.2 for ; Wed, 05 Nov 2025 02:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762338931; x=1762943731; 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=ffwDWl1euFeh/d8bsIt6qdslvLQdjZaJDHY4R0/IRhc=; b=JzHS0hhqAHPOiyhAA5fJCRDPIp30f86auMJ/o5i+H6Hug015obZM1TwV2mwXmu08N3 feLuNvtr5h2EyOaXsYdXAZhoU12XiP8kt4nei3IsdoHdxwFap4ZrrpYOQAWAX6jT51yM Z36uymj5TleaCsC0BtU0l/L1gcqNWQEzg1RRTR+1KDdMe5tbXDYLjOijSO26IvkiclLX lMzc4wf+lAZM2/YEdf4QmGcfOHljqe6xi/9tEnJkXMTGCMI0RoDVy6oZK6EASPBso/lE EIbK50NwLOR8U8olHLIB66qEmmBNJfJTxtDkU760bVWOscBctMUjhibZ8o57IKGSvLgV IAsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762338931; x=1762943731; 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=ffwDWl1euFeh/d8bsIt6qdslvLQdjZaJDHY4R0/IRhc=; b=O3F22Nf7BH21iJHNamuIFuPI2W2gWiturgjRu+sZZ5ulTgGYKTO1B0HRiVBpw3CVoO f2Z4VDVJfxlHiqcOIZNz0eqVdCqoh45gdL738Y3DobTej+3ThgSX3dTmnclk6X6OgWxW 0AGPyCQqlZ4WqroApZ30bSyazig7Sucnqr5QG0r8B8ZuXyinXs5DsUATu7CurFHw2Ukk WV12j8zjw1POGVQeIHCeD5IFUFaauaN6gboAnn48iWvKl8IqkxjaMbG9Yu493Yx03tbW SIQ41OkEjaIYbJHXx+jTjZl9hmE50mGUUgNE7B/CHd7HYAYNQZgm5FPIruYbSdPjrZnW rtdA== X-Gm-Message-State: AOJu0Yy7Djia6Gb5E4wmypiRpWgeWTtU0BmYn3sBW1cP1V6EVnEjmApB zhYpp5Sgm/pObH6wu/btinF3nc2Go5D2maIfVD3ENNU4NemK3hI+65A/j0oKaAVhpalYnkAqWJ6 lxV4T X-Gm-Gg: ASbGncsu+pZup2htdJK49LpwCU9aKqZmR6y4RADeDH6R5AxiRswvwOX9XXcCDVD3e6+ HRmloAMddRSpbPiRA5cbKw9Z5TthLjX5agvD6RDk5MQRZ2E7jB5T4J4jicfTlHRhDCQt32nZgSq 5OMjTWJEAb0rJ3pe8o+XyDK/IqqJ7h9wEP8zv8Hr1ONNbBIZpDOAERnqEc2dsxa1ryX+kP2aeqO jKnCf6jCxz08LZvEzscdv7Vzm217nZ4WhYdWtypy4b9Zs1P17aNOLYOMCjqVTCaJFHrSFsMyJb7 3BjarAgoDtUg8Vsx+f6C8vUlnY6WKSV4FxH/jZzkVqOhnyZlyWkJ3SV12SZnbVDacQnY6jH0J3g YuwSZUkdnUHkTGJz6tSqckV3N73cYM/FrYJ4n03qNT2sgRcjYUIR59Ztf8XJzOQiSwKZAglFOg/ W4s906jHScNJIx/D4c/M3qZKy6 X-Google-Smtp-Source: AGHT+IGaL1j/3biV0s8/NtYNyEyD52bRBIDAi40lrDnOzt9fFjIECkbDJilQHsfXNsb0YmXEFx5KNw== X-Received: by 2002:a05:6000:641:b0:427:603:715 with SMTP id ffacd0b85a97d-429e32e468bmr1635523f8f.18.1762338930842; Wed, 05 Nov 2025 02:35:30 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f9cdbsm9924053f8f.34.2025.11.05.02.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 02:35:30 -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 1/4] Input: gpio_keys - replace use of system_wq with system_percpu_wq Date: Wed, 5 Nov 2025 11:35:20 +0100 Message-ID: <20251105103523.103622-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105103523.103622-1-marco.crivellari@suse.com> References: <20251105103523.103622-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") system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq. The old wq (system_wq) will be kept for a few release cycles. 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..f3fcb1f4d26f 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_percpu_wq, &bdata->work, msecs_to_jiffies(bdata->software_debounce)); } --=20 2.51.1 From nobody Fri Dec 19 12:46:26 2025 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (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 BF6B72FB630 for ; Wed, 5 Nov 2025 10:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338935; cv=none; b=hdfYIRIKdC9kjqpGLQt7uuRRqeRoxRtCnVL1KhJF+4Ib2+h5AA7gDrV1CZGzPUS7NQk00U4EKSZDwvNzvy2Lqxqm5g6me2auEnaYnKvEqFwy7Sg0pJc5+iAIrYtiYJglVTjMe1Ltfzba+P8Q7cWHgHh6PNNOOJbuaDG5ADtr8+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338935; c=relaxed/simple; bh=7GtDYEcpQHm/k2cpAEkhyEX6WOZzt9cyF6ww07aUpA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vvc6suH1wWUGoBVCWKLDaKMLuPcYa7VNbAgehWsvPYzKq/vE3tPpiiRTzvcLdPcGGFkTpcz3crT7hufY2yMCeTXYHdFQuspZRxnCgtRuEIfTBnImwLniys7ORLnNVF/yrODNEZ74vG4ADER1nyVTWFDiG/juQ0J9/M0nzMIecjE= 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=V48ADvGP; arc=none smtp.client-ip=209.85.128.66 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="V48ADvGP" Received: by mail-wm1-f66.google.com with SMTP id 5b1f17b1804b1-47114a40161so16607585e9.3 for ; Wed, 05 Nov 2025 02:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762338932; x=1762943732; 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=rnTcj+uqHxj9zlocBkSTKNzsaDjt8qwc3bgNROERDqs=; b=V48ADvGPQpb+MlvYQw0lK/wxvrNh/+uS7tWvbIO2Y7WIcqB2vT67og2pSTaMiy9FJv B5pfvBs3oouoGmaZKWXLWiLR4RhHwAdxVQQTyNAESujr7VbBUc6hKUuS95l3JW3RZTH9 Niu47bHi/9WGeyTOJrSYnyNr7PL7wkAjkQzAfdrMKs5jOtgZ7HMBdlw0WnbP/vFpKAol Oe6OGqwgLmLPS8pTU+KX3R1PXxtSic0iHb5RgAYbdij+4ShwCKUR2cFGig9ME+mlEAKo yQKB3AxTH5ZmDE2BDH3z/4+maVy4p9tfTdaNWV0mMI0sAjl18ppi39ZVWDNMDIBOEY5M mUBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762338932; x=1762943732; 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=rnTcj+uqHxj9zlocBkSTKNzsaDjt8qwc3bgNROERDqs=; b=vBPTWCrf6fQvCvjg2vf780lWYZq2tInPSWLXDMsU6EH3x43YqFZkrnkGLYBHrqXEtY Pfg+62YX7vw7cMo2qLY+kwqjN3CnGhu0hqG/2Df69/9vw6wagsoBLsP6PjyTUjGqgwXG uKn+SvTbgTDIIGCqy5gyx4QZRR3ENPn/3WF16ZTEZAUQeJXcRxYFqHaTdjZ6mVlfDE+9 0revd0PYId0B8EPKZjXI9CqzaHWPQZAJfEjqkhfoKuvS9unKsKl7/E9IyLrOQ9FND5EV TvUpjL64k+bC1wp5dqy7ZQiSgB5enu2Qv+ovhnJiBbSLlvzTjIB0UrZ/MP+gKfT3JfGd uUHA== X-Gm-Message-State: AOJu0YzMdYTBi+/N57HGKlFWzDs7sO/1hvbyXmi+RDC4rI+wkDXxwiu/ 2ZjamF1Wqpx+/J8MZtAbZX9dMiEVbr7FWihaODvpnrQo8ZQuCVA+BATsLNgEgMXQ2z4OKpL2v4r Tax8u3to= X-Gm-Gg: ASbGncu0fZ5GJshppOEpXNHU2q9oSxJWf1QE2wJwP9rscUjwMzwUk7NEyLxNL3zEqMC a7z4klJYHD96QPRJQgPQkAGZqnvLEYR0tMjLsPm7pfLwyJgSBb/kXCe0uQV7ADRG+QCJzHC7oyf pKMi4fmhx9T8CFR67qcO9LgCDpZAXSOITPL7CW2JTcsV3b6HpSrHmugx3iy2OtufXfoJS3RiNKS SEwPehloYFcyDG3VUANdVnw+pBPuMY8lQv65eGmcya4JtkLphUvp0ZLEIAz8PQ4bU0EFU/ysGHi YvU8Tuj/EQScuh9oLro9nKUnjlQD2iuOmxc5PSv7N/uVVJ0djADZt1Ksy4d3Hu8XtKRiiSAB7fn V2C904bvfK+baRgWbDwTkdSvFaZDrC2L4e1DKFCnjpWfJeU9jyLhd3DUeqCGpcc3fEzRVku2uOw 7maqqm3ubQ46VoGDWISYy0hjpP X-Google-Smtp-Source: AGHT+IF/Kjv6keF0dVFlq2e7G/uaOM8tjH7gF1BnkhBuMd+aZwUz2zSj9lYOHeyhfgewGMiByThlVg== X-Received: by 2002:a05:600c:4e53:b0:46e:4b79:551 with SMTP id 5b1f17b1804b1-4775ce14d69mr18173955e9.31.1762338931773; Wed, 05 Nov 2025 02:35:31 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f9cdbsm9924053f8f.34.2025.11.05.02.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 02:35:31 -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 2/4] Input: palmas-pwrbutton - replace use of system_wq with system_percpu_wq Date: Wed, 5 Nov 2025 11:35:21 +0100 Message-ID: <20251105103523.103622-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105103523.103622-1-marco.crivellari@suse.com> References: <20251105103523.103622-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") system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq. The old wq (system_wq) will be kept for a few release cycles. 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..2d471165334a 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_percpu_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 12:46:26 2025 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 9A809302767 for ; Wed, 5 Nov 2025 10:35:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338936; cv=none; b=ZgeMKtHTwL+l2/fdI9nrgoefljlIKtOHao3X9JTm0OYEAninrHdFZv0/Gh5Vr/uLr3yxVpiUgFhGpsWYMeE7yZcAEBmzPvleKXWCF0rzglxUJaO/PP5wRrtCH6E9vA5alz8flM02ubH4MDJegsGUmTHFD8wii+kepEax2NTITtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338936; c=relaxed/simple; bh=yQWNSaUUwgQgN2VFDTHYdi8PjODCWMlHlgluCXS759s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ctxxo4N3JsJqrOiqgLWXKlnoQhY6hhY1eX786fkz/F49wChuXMJv8I5ZSlFSlzNesCttfb57P8Kt10OPf9d93d2AaQ5sGYj8T9VuAdLcF0Y6dTxbPd7oFL0G9GnTJdG+HeIFcRdSzpEQQVWQuV97xBGic+BsDWssVYl7IyPHQB8= 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=Jv1aTmcB; arc=none smtp.client-ip=209.85.221.42 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="Jv1aTmcB" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-429bccca1e8so3233212f8f.0 for ; Wed, 05 Nov 2025 02:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762338933; x=1762943733; 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=8PKpcSlksAOjg1bpKhuMTik8R4CLWI2iP3FPu/LOjrk=; b=Jv1aTmcBxQLh908WpTAJIsJ3P5qETR/GvstAPlnynR9NzjluP6YomtO96LX2swJOBu qE/VsXLVosleHmfIdXWuOSlwmi+dBDcW7m/Ic3uJSb3IYHb9Vv9hqjLkPu0cs5xmGYMy etDsaGuaCp8j4eT8VAd+tzNQEyaQLGL2r2AmM9XRNqt/N5bsOVhjSMAAv8OX+NXGdwjf 1XXTkB5tns8Cq7FE1Grlvk3hbGjLvP1aNCpUP8uw7q6cwGNzNnJGkxu4zPwOeUkTDE6N wZpxiyXWHoYGXz2S2JbPiMpBVy0l/BKMZejpfo/zI7ugD5mVGM9sm6zdUImM25WVu9wr fRag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762338933; x=1762943733; 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=8PKpcSlksAOjg1bpKhuMTik8R4CLWI2iP3FPu/LOjrk=; b=B79pUvG3dbskp9ui5fUeAeHnFwt5oDePrBWQ8EhWGeCnZHyKsx2WbESQfFXD9hdqZU KvDd3NiwwKxeEIhLetjcLvYW450F5Mf4qzy0hwqt1ChGIxRj0grQSyT81cbb/UV6FSJz WfulbPxhe/Dj/Ys/cPgexT0I9asKaG+ucoBVhLCcBwpFBii3JRem89cpvxTuZkLZlHIp ybeZpOXK+DFocN65Q68bxFlImyj/gpbz45fj8kSxOUQ1vrlD5OTqHNSDLBegPSlul+DK y4W/HCCJWuR6qx8r8oIjfOR1Vl8505uRCSm1zuu5L2b7LNhIIpUXkmO3HZehB6gcgtV2 FxsQ== X-Gm-Message-State: AOJu0YzEn0GqgxP2+rNK9n01nvWNTmEdJ5qkKM0TPa6DMsFEciBf5KNa VfLdQCuRD8vU8lh1r5rE7/Sqmo66S9Lz2EiMZyKi5j5+FbZpc3OxoE6E+Z3T+2nwYMRtQ8eZG6F sUfnI X-Gm-Gg: ASbGnctFZZfEg7A7E0oHTceLt45TutzIu230iwHTfTNR+NTllqIniEHy72l29dJCrIN LdHa48HumD6/6vHcG0ZFO9SGUrvcKSogFHpKsn2/vzaUcXALiVK0e5pz6lZRrDFeWfKeP4aaidw Hl8pDo7UfJqiQqabklxWxe9sFE+WI7l6mhJtJmv3KR7Yw/RnfVBlSeXGSYnxzHwlZQ/qcUcnP4s a/U5mb5juhce1SVaim3W6F4RPA5GUXJsqVPZQZqvTxBchNBn17mjezS4wmtU2P5HOfIqEOCLZm1 ew+Ry+w6FAZOBlfQ3ejq1UPv7n7xCX9rQsGZHNSDaJ+fzxOOMm5XjShN7IozqCEmmZVzpu8WQ10 qDKJ2U5Q442nxZCs/0hBsuuNsKcT3AWqq3POAV3NtlSOx/DgkJx0UuDybt1zv1ObEU4biNU2es0 bJO3UlQgcwvfRqhM3BuNo9s3p2 X-Google-Smtp-Source: AGHT+IH0cV0/d/aLL8pmsW5H1quW5zXkuj+DouBFgJmi4MrqNq+xfInqJNpalGNlfdknwRlZZqyghg== X-Received: by 2002:a05:6000:220e:b0:429:d742:87d8 with SMTP id ffacd0b85a97d-429e32e45dfmr1859167f8f.20.1762338932650; Wed, 05 Nov 2025 02:35:32 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f9cdbsm9924053f8f.34.2025.11.05.02.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 02:35:32 -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 3/4] Input: mouse - replace use of system_wq with system_percpu_wq Date: Wed, 5 Nov 2025 11:35:22 +0100 Message-ID: <20251105103523.103622-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105103523.103622-1-marco.crivellari@suse.com> References: <20251105103523.103622-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") system_wq should be the per-cpu workqueue, yet in this name nothing makes that clear, so replace system_wq with system_percpu_wq. The old wq (system_wq) will be kept for a few release cycles. 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..d42c562c05e3 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_percpu_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_percpu_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_percpu_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_percpu_wq, &touch->dwork, msecs_to_jiffies(NO_DATA_SLEEP_MSECS)); =20 return 0; --=20 2.51.1 From nobody Fri Dec 19 12:46:26 2025 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 91965303CA8 for ; Wed, 5 Nov 2025 10:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338937; cv=none; b=iyojtPPM1RfwRlcSkbkVgSVzmdKNbMlt2IQL2+iQswHpenbivAj08haVjsqqs3XF8RvzzkO453szqL4/DNE6oqNBytcn/Wc3Y1UeqQhv/HvOWvsWzsf860Fl+n4Ji9mJBae9aQfkM2UJnQPw9EI2FAybSq5Xcgg1RFKglzrk6Zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762338937; c=relaxed/simple; bh=yqbu7b7MWh+o9G4RkgUwppR85QBaqUy6TOfNzXk7g4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ijXDR3tG9SFQCNcLolEgcoHhK6VJEQgQgLgmMw2RFAZUK+e0+g9vDoLOphjleOKVd1u/Mf5iJUqmjgs1TGwzZmbxeFnGXDpDRMchVvYuueNQG7TfqMGOjuLLAtK8onauXiyq/zSYLFsLekBVwG7J5GDcKOwCzUVGMIS8iskmAkQ= 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=KI2Cqd/w; arc=none smtp.client-ip=209.85.128.54 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="KI2Cqd/w" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-470ffbf2150so3249085e9.1 for ; Wed, 05 Nov 2025 02:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762338933; x=1762943733; 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=j924HG2Q+xtogTUybUu3y/yj+19EIdBYoNF5wDoWcHc=; b=KI2Cqd/w9eLdSC7Vq6fKTyqZnuue2jzTiLr71lm45805vn+q+Ua4XPvLZYAkypRQ4v K92twBFNiNf2gBI/b59Ku6q7/ddTiptHL3wUTFoGIZkGUcEEapEgPcsxBOyVS7RAnLjZ M46/EhmeafMVpYigoC7hEKhiSi0M4H47WkduKrugWDO3uCszIZBX/xIHDHZ+G6dxqeYy ZEOTJtWuN1Am+Ac7xvhb6/CYV76If1VxruFKwPUzcSHWaaPz6dA8WugUDj7LXCH1j32x chY54WoLnJI8cQ2pwQRDSEg8Kkrf7FE5h/HaK9TSogC4R19atRuWEUa2HprKltJySja3 mbIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762338933; x=1762943733; 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=j924HG2Q+xtogTUybUu3y/yj+19EIdBYoNF5wDoWcHc=; b=ae33bOsifdxymAKsauLarOJadLmfAqNIgj+sVvnlXcUk6LaWxZId7rPZlRx63ZAJTZ /nDBwcXrLjFY4/6g1jU1DBdgvqp6PvG35oX1G6ZDPwExbnQVvRSc3Xk0cCr35yUTjnSk hMBHwKboknzKYLxnHYx1fMWnBbx3lmtvhXYqAWJjH/50/stLvtZdvCR8A/v7KJjOObN/ ACUULAi3vSt7bdzR/nopy/wdpARfH3ZTkwdvq2YsMsEN5ssOQpSKPssg3juVDBXI/sC5 xyXw+gU7R/V/dncBfmZGHGn/cXW2U/PEHCQbItLx48JFMmIJ8lhSjWIsE8lySm4iTQwG ZGwQ== X-Gm-Message-State: AOJu0YxoB924XKZ+fwF8uDXWACEwlNKOSGGGG3qQWFFkowGcLNAzZ+d4 GxpVPD1jtGP1ylFOVt3Bo6480pImRcKvVdWolYVu2e8jDZUEuXgW+eQ7tnYb6+idcTSIkYFNo3Q r5m+6 X-Gm-Gg: ASbGncvK89lWEW2s/5c8KoOH5+Unnbk3K7sMJAizxZ3588I1b0mVp7hvIgT2Xohzdy3 ZKwmcsJUHuKbV5o3CPru4+0X5s5Y2Dd1VUZv2mFrNrMvlJnnRYTqI0whizy/8Mf5TPZFp8qmbfb uHxVk2OVBHgoe0M9XpepsEHIuH95jZsG9HQCr2Nca2RWKwUMLbPd/OdCPd5+/LAO3hvB5EgBrWV +85Wsam9xtjcaCeRqKxIJmdJhoS4oNQK8eQOkDOubRfkGEqOOgUF1lu1jEyCMQyJrRRzcKdtZ8T WtzQv//IpLa46D876415w+DBto6RoZNIoifyJaemdzsrnfxLULk4aI/Ta3XycIwiGEQiV8qIepI wf4ZgXDS/1Xcw0CR3RpwOLRsE0ADGrLcTZK2l+xlw+CVVFsD1AYJQkpqkzzerNP4YBY0B4Dk7wt A8yi3BUUfmwtzNp+IxBAPng4Fo X-Google-Smtp-Source: AGHT+IHko+T7iXzjNaTHv4D0TV8/bTpGNVLuCGfq/p6VzjGqrwnfKfb9WAEoEQ74rgmR+vZ1wqGEyw== X-Received: by 2002:a05:6000:2508:b0:429:cc39:99c0 with SMTP id ffacd0b85a97d-429e2d888abmr2436379f8f.1.1762338933560; Wed, 05 Nov 2025 02:35:33 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429dc1f9cdbsm9924053f8f.34.2025.11.05.02.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Nov 2025 02:35:33 -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 4/4] Input: psmouse-smbus - add WQ_PERCPU to alloc_workqueue users Date: Wed, 5 Nov 2025 11:35:23 +0100 Message-ID: <20251105103523.103622-5-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251105103523.103622-1-marco.crivellari@suse.com> References: <20251105103523.103622-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 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 --- 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..5d6a4909ccbf 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_PERCPU, 0); if (!psmouse_smbus_wq) return -ENOMEM; =20 --=20 2.51.1