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 AC41D3BED69 for ; Mon, 11 May 2026 09:29:01 +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=1778491743; cv=none; b=iVU1NH8192a9sH6KB4Vo076dSGErjYOHqnQltd6R38o8qFejjpdqIaFqwLZNDNmwIcD+Frb0EWXz4qr6QEZuJgvtKvxCZsS6zAfAkpTVqxRHQq9nsKUUkurtqCubVRTALcIE7Fw9fwsgdkZzOMKBKeuZ4OzLu4W01KOKJ6ryYJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491743; c=relaxed/simple; bh=FUElfcPrwKM1P1C2e4YAuvNqKXojJwDlHLEXWbmd+O0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LX9rl0DoM6id45O7N/mtLDiEvz8QYE91pS2mCa3JK9Y2kiSCkSYkauNVOJvpu3UGHJgkvRmkCDAOpLgkEkZKP6V0o1kO4sAdAyiH/6ILQ7amgcDD8bHXLAOfCjnSQwS+fSbY7YAgm6ZbIOyeHh+0Vv6RBLDLb7O5x6bZXBw3gAU= 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=DyDUOSAp; 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="DyDUOSAp" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so45975485e9.2 for ; Mon, 11 May 2026 02:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1778491740; x=1779096540; 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=OFnchCOERV/K3rqnNmAlO2sDAoWVt97APGhHAMjqjX8=; b=DyDUOSApwrveoXQsoEHcbmlnHY0X1X2cbUv+04aq6gUh13R741ICk4wwaP7JbWozhP 8DUtE6XJSokSvfVJupia9e0CEu7cWYM/ADD/bQTWbdXnUV+upaH+35eNqZaDTWp305RB 0lvmO2AwInC9AhWXt5NFa3acgQzeYZSBoS6uBgzgBKE4dTtMf3COK10EqJfK1pUWtp3n FYRb8ExDv+9ddQd5DT3hJ64rsVn2OpBiSrrz47vR3RMhAFROAX04LdZHVK1dz4MD93P3 FHCPO7IouwOL7HXmh0drICkb8RWXWIYiTRWlTZrDKx7/URaJBEUqHnMAncQkTGXf52CW 3dew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491740; x=1779096540; 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=OFnchCOERV/K3rqnNmAlO2sDAoWVt97APGhHAMjqjX8=; b=Tw9NCHUPWcF7ZBjqBiHF8NmyiFaUPgcmpvFIAo/mtJJr2LgR6674hT+6p6fY2jzmwo HKLzfGWb64O2WoSdw7KIT7lMxWAAk9pvm2fLU2tbQrB5Xl4JexBw3Hyhp4q+969Ytv99 YSl8YLgplMVP9WSzlpuF634aR/bQDkEMviS0BSOc75LGFdMUMOJeWMRv3DbSym31ZrWz dM8q9PS40272BbqVD/ABo5GPkJdY0/y0SHmoBPwt6r3Cq+bN1jmasypp9OCF9zNPZmY8 1rlA1tmP1RGKa7eES7G+W4wPyBhJue4C2lWvoHt1Gog1mDj8+rW4+JgxyvoBtb6v0q1r kWOg== X-Gm-Message-State: AOJu0YwXBbDl7DPAIktS/D5I2uOKz4a/sjDEPiTM6nSrbb59YOG+U/eK 4+vQSmwLCIm8vJ79ts11V7++B5h8iYcESJM6MNUl7I8btYDtriGLlxvpLxxkPw0TIPsS8JDQ0w5 cOazmrK4= X-Gm-Gg: Acq92OFoefaBwupSvlfRT7uDICOozTRUju/w1nplhoXtPLY/iOYps2dFyy2SULgk51l VwLbXliQwkSh/A63GTnbu4Pr+CD3Y8bmK+88Txo43TbZNJKzD03eU9P0x/uO0wrtqpVavsrP2EX SxhaXdBQ0iotPQOscR8l/cfuWu5ZSrEzOvySKDmdxsVUwE2qhyy3/+MhpNnIEauECdk7C1iBakF Jvq85k5xnLuJQEt5hBqWgCay7aWDrCqVx6myGT3miOA5eCuJoezY+LulwDfD+N3kebz2YGtmaDD y6GG9R47gVS/WA19uMcTaLX88pdFeBHDzbCVcmCou1RlljLf310DLLXJqgJExnAC0KwVZxT6305 0RztdTng2614TU6VQVnnntI7xNPaTsT524JCjqAvF04z+ka1X8nX8XU0U0N+/sKr4Y1rzHwj+Bq o3cc796tTjd3UfkfddJ3vPqPVxM4BcjoOx1fKzyZ1U4KR+FY5lVSaKL/Sq3whQfYFJHkix X-Received: by 2002:a05:600c:698d:b0:48a:7676:30bc with SMTP id 5b1f17b1804b1-48e706f11dbmr152723555e9.14.1778491739910; Mon, 11 May 2026 02:28:59 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48e701e89fbsm157606675e9.4.2026.05.11.02.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:28:59 -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: [RFC PATCH net-next 3/5] net: thunderbolt: Move long delayed work on system_dfl_long_wq Date: Mon, 11 May 2026 11:28:38 +0200 Message-ID: <20260511092846.120141-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260511092846.120141-1-marco.crivellari@suse.com> References: <20260511092846.120141-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 --- 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 7aae5d915a1e..f365ef642b62 100644 --- a/drivers/net/thunderbolt/main.c +++ b/drivers/net/thunderbolt/main.c @@ -315,7 +315,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)); } @@ -464,7 +464,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); @@ -704,7 +704,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