From nobody Sat Jun 13 12:29:49 2026 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 BED7B3CB2CC for ; Thu, 7 May 2026 14:27:36 +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=1778164058; cv=none; b=SHrnKZaZgNQ2ppoj2H6vH4ZBwQUFJ+t20l3x79yV1QenOqDfCPuO7RpafPSE4G19i7XzNxK4ndcmvFU0qj1F95Of6PIkWVtdCPHd1JW/xOrA0ij8c3MC7ISHFxjaVZyT4cChNRbTMVrcGwPWTTx+QQRt0QQPY1Z8WK0hxqR1uPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778164058; c=relaxed/simple; bh=kK5/eqAKskXLgUxGX//o6DmJtwnWfZhzhzL8kiMs058=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZNJZ7p7UaDyaxXMKpFYL6eh/n7TTrSPgpadAPAMoqfK/CIQNzcn52fqBpR+ew1ycRKhWW31SlgR4jon4rIYkFIL9IenOCfgWcJMXfmmeSEX4m3sE0DbAcK4CDDQNREk0nP5/FQfYR47QnJcQwxfe4Fflz/GCaiQQ2kYuEODw3W0= 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=FH2zI9I2; 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="FH2zI9I2" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-453903ee4adso456272f8f.3 for ; Thu, 07 May 2026 07:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1778164055; x=1778768855; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ssrhn9EPf35gFMhcF+CjH4mHClEML1PAb3aIpGxQ7uI=; b=FH2zI9I2phsXUi3z8u+les7krmG489h3nX2TSKE5/cmIBgkHQv0fLTDW9LbYwnJJmI KPq/jkosvx7LJxvwBNSH9pjlZ9ClntgBljqBwmpzuiCV0pm41agxv7VaMQ2XNhJil0Uu wDLknLYR4/4tZep36oipLD4lm0EXfSln48lTGfCYPg9+QqNzyHk9+/2fWg9srh2+2Vlq R8chSK1slnjMzTSlhdp0S/eIy2gerUCnqML70ipPOKJef9hRMITNNyLkhDpWr44Jl750 Iqxa70LdVL3SD/JbenUF8wQi2yHqiwdcLE+Yk0HvP5s99eHQ0+tJVzAGkB/Y9BVubLCz wvCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778164055; x=1778768855; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ssrhn9EPf35gFMhcF+CjH4mHClEML1PAb3aIpGxQ7uI=; b=MxNhl/VwAUj1h7F34zJtxTB95ksvoh0BMeBe4wTSFrS28GV8561Xh9a/XKeVXUa3g7 kEItmysctKrbf249+GQP7Wxk+7A+Ufif2bHrA+XTqIM0XOKJoJqIFKq4l/idgFBhJE4s sYoTjvy42qqOyvfRF19ILs8vg+NWW1V66OL/+0b/tDY0OD+hAkeqolBtnS9ZrgFb7Pm5 kRqYagwU5q9BZOcR5ME/Wom/GgWnmPJ2xbXFqHBsWAX7CFgHuQ/GkQ4uUS/oI/Fch+VF +Thlalq4XmU8DDWPI3Khrw/9k3g1Yk7W8GY0Qt7sxfRACBrEFKJX/qOMRJH3x1LYNuvN /06A== X-Gm-Message-State: AOJu0Yzjp48EWK6Tc2HKobtYGkwEqlkdDFSG3Cg+aFmfeWa+TACMVPIE GGim3NE71MiN/XtyA8QDt8AF7abjnvLXrmhZMrvUON8YHZqv72PmaMr/KPGAW/5u8Cia0qJvNLs nYns4c5I= X-Gm-Gg: AeBDietsWHYHDOmchlkVXq2E3EVfq+/6MOWaw0/eaKAk1uGmDg4PWPnGvDf/2FIgdtY znDaol4q02hkzT8HNfcMjAdXwHyzkJjGRlFmW4PLvhuLR9g8m3aukhWo5sHFIicoezgzUWKudk4 ErxOw52O9cyBNuLdVCPN2WwhqGokWFFDqBEOoPeOriyhB1hWLXEpY0V5T8xCuQAPmS4LebJOqy/ MBvyRAcNQjFOXeLya1Z3vcRjXjrrYIrmXpzLrn75SE5vJOfBGIxgIcuXtrGVtHtXfMyqbqjVzfv cxaq/z0mg2zkyBp1MvJHiOC+7XTDSCEgxmrps88Ei7CNwgw74rU/N1ruNZZ5kq0F984OSUQLfVA KPP9Ke4Ona/FmS0A9O9paAsb0MI/jYglVbUvPyfrvUsy1HCCVApWlcd7QZaMDw/tRjN7v/wR3Eh 2SP1PnI1Voi/Z5yhqVoaNmsa8U/Q+uxHRott0ONV7O5YAc2pCUsWhV9Ub/LS6eqNd/MofF X-Received: by 2002:a05:6000:2310:b0:43d:773d:7908 with SMTP id ffacd0b85a97d-4515d3dc438mr13491746f8f.32.1778164054933; Thu, 07 May 2026 07:27:34 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45054b03d4csm21268234f8f.22.2026.05.07.07.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 07:27:34 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Heikki Krogerus , Greg Kroah-Hartman Subject: [RFC PATCH] usb: typec: ucsi: Move long delayed work on system_dfl_long_wq Date: Thu, 7 May 2026 16:27:26 +0200 Message-ID: <20260507142726.331206-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 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 the code enqueue work items using {queue|mod}_delayed_work(), using system_long_wq. This workqueue should be used when long works are expected and it is a per-cpu workqueue. The function(s) 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. Long work shouldn't stick to a single CPU. Recently, a new unbound workqueue specific for long running work has been added: =C2=A0=C2=A0=C2=A0=C2=A0c116737e972e ("workqueue: Add system_dfl_long_wq fo= r long unbound works") 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 system_long_wq with system_dfl_long_wq so that the work may benefit from scheduler task placement. Signed-off-by: Marco Crivellari --- drivers/usb/typec/ucsi/ucsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 5b7ad9e99cb9..2a0bfec3e43f 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1965,7 +1965,7 @@ static void ucsi_resume_work(struct work_struct *work) int ucsi_resume(struct ucsi *ucsi) { if (ucsi->connector) - queue_work(system_long_wq, &ucsi->resume_work); + queue_work(system_dfl_long_wq, &ucsi->resume_work); return 0; } EXPORT_SYMBOL_GPL(ucsi_resume); @@ -1985,7 +1985,7 @@ static void ucsi_init_work(struct work_struct *work) return; } =20 - queue_delayed_work(system_long_wq, &ucsi->work, + queue_delayed_work(system_dfl_long_wq, &ucsi->work, UCSI_ROLE_SWITCH_INTERVAL); } } @@ -2109,7 +2109,7 @@ int ucsi_register(struct ucsi *ucsi) UCSI_BCD_GET_MINOR(ucsi->version), UCSI_BCD_GET_SUBMINOR(ucsi->version)); =20 - queue_delayed_work(system_long_wq, &ucsi->work, 0); + queue_delayed_work(system_dfl_long_wq, &ucsi->work, 0); =20 ucsi_debugfs_register(ucsi); return 0; --=20 2.53.0