From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 B7DD53E1717 for ; Mon, 20 Jul 2026 10:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784542165; cv=none; b=N2VeWM7PWBQkz2V/xsipF6CSpxQe1gKwjWxZQQCLvE+2YgEGqW7v5ZhMKEUGUmX2/rcoIssOTh5ipupcmb2Hf1esD/fdokR1RNFyx3GfKg1nQObtUddYnmiXY0GLUOYz2mLciNZpwiJe/I72GkBDxRABTozXvTTiKCUZPeEBkFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784542165; 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=lfbkaNM8gtM+w32K2ZAFrcVFr6WbJ1JnZBX1bbJkRrnKAv6ea9xAKJ1BUmh+YEELU1AVwaSqB2s6UQhkxnPT5GaQF6U6HiGHySW+xDlTxXDpF1zqgzMTyjmbnv+qiOMREF7snHoQL9OiLntoY+owl8cQlr+/Jb4GpRPq4zFVG1I= 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=HzSbCXiR; arc=none smtp.client-ip=209.85.128.43 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="HzSbCXiR" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so76037305e9.0 for ; Mon, 20 Jul 2026 03:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1784542155; x=1785146955; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=oPb++nNOUKaZMzssqqTK7VRW9BEodDg7l0QT3ply1Lg=; b=HzSbCXiR/0+5O2iVMSZn8xWF1x7z3Cu4IKN9ikzzP/nQoO4pY1ga8e/BjEiMIBaupT 7CVDdIU6TsbsaE0SGipppwOy2yGQhYIX+CgVV3VWXtqFn8dIxECujxDS64a5OdImlF3w Hq8hWfjPHDzLf/cQUlk4xLyBK0oEhGscNH1rZX/bGccCK5aiEsN/2U/JY+2bpE7lRUVN 2a9+vhKx7VP+pUG0j0jalylNVOZR+GdykJrggr/qRClpdRld/NwdawE7yysqqNbr86Tc roChDyDuG9yAyTp7nF4gevTPFnLzDQdKvDrDkGb99Tw57DyJBJlIuL8Fshv9+ti6qnv+ qE7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784542155; x=1785146955; h=content-transfer-encoding:content-type: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 :content-type; bh=oPb++nNOUKaZMzssqqTK7VRW9BEodDg7l0QT3ply1Lg=; b=qh99YspH0mEl40PW4VxdyMojN1qDfM5Icdku5s2L3dWFCu22gZnKZjk39XEgAJa9Nl pgyG4buOh3+H5prGlXbmHi8B/VdyysbqShHflISlBoKF1tNEBvhtxcwdKiqYilwnivUl lACIDgC8xyQ+/s7aC41BaMaN5fsj/W+mHH4W09f2ugJq5mxMqG5ux71XBQJmXrKhBkdA VbTlY7KLvdn7KsANDEJChXK64qUAHRkSpzTyLQ+G8etM7bdL89hAxMFPeKm2OaSlO+ox Up6QYW/36p3AIvQ9LG2TeFH0KCid7r5CdxZtxixGLu3Dk6fIcjOdC1NC9AJgEjfw1kSP CKRg== X-Gm-Message-State: AOJu0Yyn6HG44K70cHEfQ74RFBc+9qKPZyhh0D6nPjmTxW9KuvMTe25s SIFfTbpuKoRa49iEYu5sL25tyDMEIHLL/+BIYlcVwvjP4GGmD5A70azbKj+4ZFSAv6ccAlkI6AN 3suhpLjw= X-Gm-Gg: AfdE7ckAvgb7jXO/aVbeTpo0kxnSGQtnmZ5jY+91x85TPdDlQu9R93xAzt5AMIQdVXs 7oLR2UA20dp93bhssU4S0/SA7klx6joNfRSOcuY4qHIJp0SfdPW2ipX15Uzi812v149DVrWMLmI i1soLRUUgxjfEdtvRnk2C5E+FPkn0liwTcnU7ApF38fe5UtKKNUp97DnIwYTwTT02/a3na5ig85 Q7PWDeSW4nqMqcIzj7Y7aE2nSmBw0l+sTje4a4EAZT0buoF1xdFl9V78g0bwq3EIZ/3LgbYL8oy jSuFrsJoTOYTA+ZOOUYJMLAK8BiU2ipxLlJ3YBWQCEhNVkLrtbtcDbH45zvX2dV5D+pUj30KESb OriLl3Sn47h4QbMoZVNfw/3GhqQbKtnSVPdL3tt8sRkbruGcy6JmaHVG5n5ImhHvf7KhzGsx93h uL+JQ/e1bsRUkqJgaUI9d0Xw11hQ== X-Received: by 2002:a05:600c:4ed0:b0:493:c634:952 with SMTP id 5b1f17b1804b1-4954a3d0872mr146603125e9.7.1784542155280; Mon, 20 Jul 2026 03:09:15 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4954a2a2504sm294792995e9.2.2026.07.20.03.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2026 03:09:15 -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 v3 net-next 4/6] net: thunderbolt: Move long delayed work on system_dfl_long_wq Date: Mon, 20 Jul 2026 12:08:54 +0200 Message-ID: <20260720100902.155605-5-marco.crivellari@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260720100902.155605-1-marco.crivellari@suse.com> References: <20260720100902.155605-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