From mboxrd@z Thu Jan 1 00:00:00 1970 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 43AAC37FF5D for ; Mon, 6 Jul 2026 13:40:46 +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=1783345247; cv=none; b=h01B/i9XzH25vKTBuMzZrEU3+C1GmJaET6jmoNSWxhBuVhH+j9e5eo2lK/tysH+Jhd1hwCpOrHR7rTF6vdkeyVnW5SYG1UxnDYuX+Byxd6ARb5ti0Eky1CpVJgn5zsxfaUgzwdjMrQnuA3+tBsL/Ne0nyT6etZCVUybgWyESrL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783345247; c=relaxed/simple; bh=MzHFCd0Tz4e+Edg/Bq9oVoskUFiz7gl+EF8d1HofN4g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qT9/8BhcAKZ3cOfGSCj/AOnQZDmP5NsUTzE2RBNd7HT2vh66tq5R9N4gf31hG1zMAVTBKzPtwgvdIMO0y7wZ8QzLHSGwEH/+1ULl7PPjHClyXRV8AJTAIgWnZoO1cUdyUI+7V8cgzqDlZ8lmWWwREiR4hDC/rHXc9bjtPHfCCOE= 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=aqet4J9g; 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="aqet4J9g" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-4720d22c94aso3022542f8f.1 for ; Mon, 06 Jul 2026 06:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1783345245; x=1783950045; 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=oPb++nNOUKaZMzssqqTK7VRW9BEodDg7l0QT3ply1Lg=; b=aqet4J9gZ8veBocO9/+al8eTmA68Od+SxRXY0LbEY6P4Nrj3yDFVvttG6t/shM8Rr5 /HsxvCKFKTFDW+EArNTyFOEXmMXn/fpIzx1xtEBYRMV5JvU/Xc1ITDn0hbUUwOzUo8pp WCNy7wRoC0zyNYlDwEE9dkJu2adwu0lPIu7gTtmYI1kEtmSOUTdAN02bwSsEWkVFu5NQ PD8xPZ/ucx+kVJ95ugVWyagrYNy2DglsJ01aQ8nuXykEZKDQz0eFTkp2oVUUvFTS36FJ k/n4tN6/L97hHUB/zo/D5BHYgLHOOGfnv/37raBUMOAupHXJCo5G7p6XrmdLg6Rzskj3 wIIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783345245; x=1783950045; 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=oPb++nNOUKaZMzssqqTK7VRW9BEodDg7l0QT3ply1Lg=; b=HQ+a9BdGvTAvzP0q9ii9SxRuEHwEmnCD0isu9/475sG3tqGJDGXNaq6YwdqjMYkCNo 5xpDL+thqJN4L2/rpiTqwVFn1ui3LdB7xrTEOb7IBdAxsI3O1c7W+oikpz2zyCL/IbKF LZvcRDhVb8Yw9xqqD2Cy4h+v5r7HgH1fNyr1R+PvNXA7sqx+eyXTzS5HrnOK6wsRV4nW WOvTe9eWuk7498T7A7BsmBqrZPZiELw4xnAHd9C0VTKRrIymKpTW7laA9yUt08nZYfky +T6QZUITGvEJe+m2MxG2ubCDp8GI+GpBqJJjKMQb3pHB0x5hc7DAQrU8ZkVS9Ef4gBD2 spOw== X-Gm-Message-State: AOJu0YywbkXc6Y9DErsBBt5RkdIFgQujdFoRVmJIy+/NQ4Jehq3uVR7S JHDh4jAqSMA8rB7ROgvinocgOcOWmizwRNGN/Utv4yaES547bM91hStXWOaW1Rc7CWdwGL3YFKw yY2WPYrI= X-Gm-Gg: AfdE7cmQ5ZxJ0TbVeUY0+03Ecfsfcx3beLmxt+k0Ggr2tPSBhVi70yPKT2RNlfpiWsx gxtyOio7g+UL8XU9Ne7H4ViozHF3R0wPxRW301e/ebMvvC2/UOeQ2X669EymErJa4bV/WzH/ceG m+hJ7XmxpDmAbfUzurADv5WiEubO8wX/QQdJmZ+Qr8qOPGUPbQzQQkKkH/i22yxB5Ml0i/9+9aX 8Wg8YDL+ittDIaBy3yrNw13ubFwVT2p3/j0J/OOPVapxSf9oMLE/2yS3up55C+NHFjsap2CHzCh 07hajv/q53jvqUIb4phWfv/56xfa7o++w3+XqXcOuIzDrkB/o4ldC/Uf7e5BRGGPtuXVHHy+39Y 278fk4w+qTAyhXYiFSrDx5yEgv2zGxTC2Fk7AC4Io7dEzNJ6Xq1/9BvdRuQ6w/YNYzwtAoK/ZsY Z/I143fQkW/WV0jSAVWS4UsDTY7ZaTKzC3zgY= X-Received: by 2002:a5d:4108:0:b0:46f:f12b:e457 with SMTP id ffacd0b85a97d-47de669c22bmr236646f8f.21.1783345244677; Mon, 06 Jul 2026 06:40:44 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47aa0f214d2sm24424868f8f.33.2026.07.06.06.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 06:40:44 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mika Westerberg , Yehezkel Bernat Subject: [PATCH net-next v2 3/5] net: thunderbolt: Move long delayed work on system_dfl_long_wq Date: Mon, 6 Jul 2026 15:40:26 +0200 Message-ID: <20260706134033.244295-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260706134033.244295-1-marco.crivellari@suse.com> References: <20260706134033.244295-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: 8bit 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:     c116737e972e ("workqueue: Add system_dfl_long_wq for 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. Cc: Mika Westerberg Cc: Yehezkel Bernat Signed-off-by: Marco Crivellari Acked-by: Mika Westerberg --- drivers/net/thunderbolt/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/thunderbolt/main.c b/drivers/net/thunderbolt/main.c index 02a91650561a..be27972bed18 100644 --- a/drivers/net/thunderbolt/main.c +++ b/drivers/net/thunderbolt/main.c @@ -316,7 +316,7 @@ static void start_login(struct tbnet *net) net->login_received = false; mutex_unlock(&net->connection_lock); - queue_delayed_work(system_long_wq, &net->login_work, + queue_delayed_work(system_dfl_long_wq, &net->login_work, msecs_to_jiffies(1000)); } @@ -460,7 +460,7 @@ static int tbnet_handle_packet(const void *buf, size_t size, void *data) if (net->login_retries >= TBNET_LOGIN_RETRIES || !net->login_sent) { net->login_retries = 0; - queue_delayed_work(system_long_wq, + queue_delayed_work(system_dfl_long_wq, &net->login_work, 0); } mutex_unlock(&net->connection_lock); @@ -700,7 +700,8 @@ static void tbnet_login_work(struct work_struct *work) netdev_dbg(net->dev, "sending login request failed, ret=%d\n", ret); if (net->login_retries++ < TBNET_LOGIN_RETRIES) { - queue_delayed_work(system_long_wq, &net->login_work, + queue_delayed_work(system_dfl_long_wq, + &net->login_work, delay); } else { netdev_info(net->dev, "ThunderboltIP login timed out\n"); -- 2.54.0