From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 0DF3830C343 for ; Tue, 7 Jul 2026 14:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783436034; cv=none; b=KXGcv1e0YGP3/hgULrkBTNA4bNlbNEJ0h/R5Sx5LnCNl+ft/xuFLHDiT42WR0APf3xiXhDue6Tw4bbNeKn6WKIiPWQGqXq5YVoh/SmsJw5F0sfzJXaXZyIy5y4Y8ueySxirYxpkLEQEXo0ZCdIqOXvYtJfojVJ0GD+cBhEwwleU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783436034; c=relaxed/simple; bh=pX2TimW5v6Qj7a5oYWCVjyPbM4B36Q3dDcYe5sGR7KA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EexzBUnlClGrHp4aOECeuSM+Ty+JI+GGX90m3YN8o9SXIfNJRvXZT4gJs2+1tW7+OeBAc0Ib6kpKWdKyNS2YcTs//69kUslvfcBa3HHCIAhBDIuHSzQTLmEff1NKuhLb++PDbm+Ln0VDJ88EZBj592MIfrcg2/K05m/bQgJX9G8= 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=bdyjhg0x; arc=none smtp.client-ip=209.85.221.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="bdyjhg0x" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-475cb71a4ebso4338213f8f.0 for ; Tue, 07 Jul 2026 07:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783436029; x=1784040829; 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=Ev6RUIj+xitJEV4aPgTHTZOjmqQHTKeTmeEw+FhXfnk=; b=bdyjhg0xPNy1wyxFfwT6ZWbwrJ3nlKuXCAR8llKUDOsAPMupdkvMD1kxST4FggaKwt hT9pl3g2Ky0Yj20dlocrsMXYQVo/rjoGHcLO23oUXM9+Gb2msLBF5bltJR7uyaIHC0G+ Bp6ncEJwzyv1+1yZ+mcwfzLEJhTVVh7O3cyRQ/xeHl+fQA+RgHDSJgAPevjDbhRIv5Cq HD/+uCH5v1uzNgzDxzefxYT9vhytukxPmszjBOoMRz/9cPVnNVvjT0eqHFVPp68+Dkk9 TxYh3TiRc3W4ANWpMQ9rE2zHD91gZmfADwkhbuK7iae3PQmFxt2l7gf6U8qbjGvPBcFQ XoOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783436029; x=1784040829; 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=Ev6RUIj+xitJEV4aPgTHTZOjmqQHTKeTmeEw+FhXfnk=; b=YqOQcPXluk349SgnXXO8LQ50PUfDlnw2KUWVFV7fy2RsbMMPIEiCAutZMI0UohANFa kelpERjE9TeHZ7yPMoKezMLQHtSyN8jFsMuToC33LeCwnhcKh6v9nS+8xde9myZbpwbv 4c9ro3Et8GV0MZAMcTTLnTAwbGvWCfqXd17ntHQoYKSnEeAZWUA0f9NG8KDPh+yU0PMI UPxNfLXO7oJ2ld8hS/i05BKDHmJ7WzrYUro3kvs/yNXNFdktaKjsKs6yjumU7DzUz1hM O8ALG67c956sU9j2VImMRZQfBrtbzK7SiuGoLDDzbXy0ZLRzSxXlzMf5nCBulTilvUPB Uhag== X-Gm-Message-State: AOJu0Ywq0lzSQZutYepf4PTOp4WSABvVThhZqSweBqI/xuCjuIuhw6Aw Jigsbcm31X4YBQoIQDtr6lWFRKxBHQTyyleyI1wntLQftdg89g+/PI9LrldjHVFpGcagaiKMcaA lz7suv7g= X-Gm-Gg: AfdE7ck5XMa9hHUbdo49H29e2V5yQL4EiSuYbTp0OA0mpCSHbdX3uksVxyv8S/ZM7Dy 7IOFy0Xv0ycTUxpe0Lsaxr59Cq96JE9+lu8e7R8POkc4rvzsGDanbJ87sr7iXy3DNHRIspQ0tS0 4A+ZIvnyGXKJUhPMOyijbyPEkeXi0YkjVfW6FBN1OAJS2qT4PDnO2jWpCV5y/qor6OmBU/0EY3A hFB26pn2iYX/bUa3ROfMS6FPJecrUtHytS4fVWf2AYIewIjcj5vo13m7rxU4QZfrUkCHpiKs8PJ 5Ls+25VDFw4OIzm6vLiNb846ejBlQznPFjUn/jPHIl0JNRPDGrShS+3wEwGf9sqWNdIm68uwlF7 g36qC0iUMpFNp8ato6ZPWOSsLwjwXw7HUHtg/JzNYgeLD6pvX1Ijq/YWiNama6Bfvm8roh/7pe5 rGHLeI1bllIntYOPsVAFe0auXhX+1RS4rOIJyIKPyHGD0rNQ== X-Received: by 2002:a05:600c:190d:b0:493:e4b2:5290 with SMTP id 5b1f17b1804b1-493e4b252bemr7683005e9.12.1783436029438; Tue, 07 Jul 2026 07:53:49 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e10af550sm60425025e9.1.2026.07.07.07.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 07:53:49 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Jiri Kosina , Benjamin Tissoires Subject: [PATCH RFC 2/2] HID: appletb-kdb: Replace system_wq with system_dfl_wq Date: Tue, 7 Jul 2026 16:53:03 +0200 Message-ID: <20260707145327.313292-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260707145327.313292-1-marco.crivellari@suse.com> References: <20260707145327.313292-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: 8bit Currently the code enqueue work items using mod_delayed_work(), using system_wq, the old per-CPU Workqueue. The function end up calling __queue_delayed_work(), which set a global timer that could fire anywhere, enqueuing the work where the timer fired. Unbound works could benefit from scheduler task placement, to optimize performance and power consumption. Since the workqueue work doesn't rely on per-cpu variables, there is no obvious reason that justify the use of a per-cpu workqueue. So change the workqueue with the new unbound version, system_dfl_wq. Signed-off-by: Marco Crivellari --- drivers/hid/hid-appletb-kbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c index 462010a75899..5cc27066f602 100644 --- a/drivers/hid/hid-appletb-kbd.c +++ b/drivers/hid/hid-appletb-kbd.c @@ -175,7 +175,7 @@ static void appletb_inactivity_work(struct work_struct *work) if (!kbd->has_dimmed) { backlight_device_set_brightness(kbd->backlight_dev, 1); kbd->has_dimmed = true; - mod_delayed_work(system_wq, &kbd->inactivity_work, + mod_delayed_work(system_dfl_wq, &kbd->inactivity_work, secs_to_jiffies(appletb_tb_idle_timeout)); } else if (!kbd->has_turned_off) { backlight_device_set_brightness(kbd->backlight_dev, 0); @@ -201,7 +201,7 @@ static void reset_inactivity_timer(struct appletb_kbd *kbd) kbd->has_turned_off = false; schedule_work(&kbd->restore_brightness_work); } - mod_delayed_work(system_wq, &kbd->inactivity_work, + mod_delayed_work(system_dfl_wq, &kbd->inactivity_work, secs_to_jiffies(appletb_tb_dim_timeout)); } } @@ -423,7 +423,7 @@ static int appletb_kbd_probe(struct hid_device *hdev, const struct hid_device_id INIT_DELAYED_WORK(&kbd->inactivity_work, appletb_inactivity_work); INIT_WORK(&kbd->restore_brightness_work, appletb_restore_brightness_work); - mod_delayed_work(system_wq, &kbd->inactivity_work, + mod_delayed_work(system_dfl_wq, &kbd->inactivity_work, secs_to_jiffies(appletb_tb_dim_timeout)); } -- 2.54.0