From nobody Tue Jun 16 17:20:55 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 67A7A3A2575 for ; Thu, 30 Apr 2026 09:29:56 +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=1777541398; cv=none; b=rOnffpeVe0he0Ws9Fp7njp5VSpctHr17lzSuwlRstlXAaMGjECle8GJ7stlYTYLsWMJhDpa/pBrh9yB6Lw/fTbw3T0osz6zaR6FKjMIPqRmrQKqYoP0S6GaLr/m/rf/TW4cYR+F/TzIsI+FSUWJKy2NjhZIvPiaHxGD3dDbZ9CY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777541398; c=relaxed/simple; bh=n1Q30ixYOtqZ55oYud2pMjhUZtd6AeiJEslV7LVNqRM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cxbJbeqllRGR6luvrzlzr5m3O+Wjgs4CzuvCLfkzsLay0ucderqdE6jKdgA7E2PSXLb2KfWto1VWnzZhLuGV5F+FGBvQbRre59HELO953HntOwtvXEjsPXbPrgMIKPnUMBtVxssU2va2TzMpcx/NVqqSHCtte9WD3wYXOxoRmfU= 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=CgJnBKEf; 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="CgJnBKEf" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-448528f4e69so423837f8f.3 for ; Thu, 30 Apr 2026 02:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777541394; x=1778146194; 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=old5jyYu22W6jYV0qg4x4mp+/GqT2/HXZ0E6OdCIxiw=; b=CgJnBKEfSiuhdvUIVBjGJZKvm3B6sEvJUi6R+xCwdZuIzkl8p0nqG8NjJ6gyPlKDG5 c2f+YlPwxSWbdKHAIyNOvskIyXjjXb8sta4fRTwtGlkTxOU0h4YcCEtpY4RkdjRjbtSJ uDurdfYnQUn/EHbJsKMfjcDR+y+ntzfbeCV2/TyBzpQevhedqiawC5CuDH3fjnASnN6F 7dpBV8xqhsrzVijXVI+lYMBy7/HE+Q+Vg6bmo5sfy0g40k6oULuEfiwoZfQ3agv2NMyC ecyngnTbkBwaS93/4NezeeUnY3TReFRasuQAjQcHD3/cGxauzdxkCu2ee2XU3RD7fSNf 1hvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777541394; x=1778146194; 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=old5jyYu22W6jYV0qg4x4mp+/GqT2/HXZ0E6OdCIxiw=; b=JMSEde4rtvpf0nVI20Oe4Rkok96A7JbbFK/OooxfWAnruym3iGDY84GT/+BPb2AJSG HMtedOpYxJMplHrFyYCMfQUd6hji2qrLgnhtq+ESLWV11htqerRHG9WgH0oqZG5QKOac gJUOPKdAfzov068vajvSQh8kbvjH6zv3+H5kXxZD3Ehrovnz7H3uHKQtDrscZYQ8V9kl o5GLKzBMYwSacDcSxjttshUgQjvd/5IqOBzg8vK4V1gaFu49xAVZJCbI//86/aWrzqw1 Rjorj1Jjwi5rISc236wF63hPD83O3B425VfLsU0NMxvSbQYJRPdACERN8Zq/HrI92ej+ j2Pw== X-Gm-Message-State: AOJu0YySbJFzjwBoZlf61DuHwkC2Iyg7KYzn+QeQUYuADvHg0oAge8vU 6oG9lRFSvpMufHUpdR/a9p7MurGRob0t7dyyGKOY+6ULrnn+pcWXnq8gNbZUP4y+OGACtkI77QA w1WW84ys= X-Gm-Gg: AeBDiesdgaMnAXGPIVnMNsiJZClKr6NtRbV1WLFl9pnWBRTsa2RsPeifIXmZRJy7alj vcW93lXpsIKO6PTzHCorMl+R4A6l5wJk2urcODpPkrsxQXDsEcnxEIgRgQsf7gkrwsrFXsEY2rH gXFFApH1glnEDIKlFxBj103z2Fwh9fAg9Y5eOyCydxV8fHaDo5cghNZkwrCkIdUbVi4CP6XL8uj 29Va86/qYB6f5RV25safbKA2xKVqEQQAw4fyDYmRlFEIQubDItymz/yrToSNa1IvHzLhcwcQHDS xsI5XuU9VbR8pwbZG3FgsRYd7UkGOb3RD5rWFWm1i2WFemOHWWdqGIuRJdTVLH2aQ0dpqPkCI7Z HXHOV/5U0BCOvRtRJnlJA5W9N/FWBZSQVfeJGSbX1ZnKUbC1e8P+BH30SqDReEN/qoDj1b7vtcX f5aYtpmiwVwKPL17Jw1E0u5QKYlREZAtY+0ZPRaoOh4sUcoz5v+z4pxDQT5LggQtgjf9VP X-Received: by 2002:a5d:5d05:0:b0:43d:76ec:91f6 with SMTP id ffacd0b85a97d-4493ee4c9bfmr3226097f8f.41.1777541394306; Thu, 30 Apr 2026 02:29:54 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-447b76e5bf2sm12318654f8f.27.2026.04.30.02.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 02:29:54 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Damien Le Moal , Niklas Cassel Subject: [RFC PATCH] ata: libata-scsi: Move long delayed work on system_dfl_long_wq Date: Thu, 30 Apr 2026 11:29:47 +0200 Message-ID: <20260430092947.128647-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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, but it is a per-cpu workqueue. This is important because queue_delayed_work() queue the work using: queue_delayed_work_on(WORK_CPU_UNBOUND, ...); Note that WORK_CPU_UNBOUND =3D NR_CPUS. This would end up calling __queue_delayed_work() that does: if (housekeeping_enabled(HK_TYPE_TIMER)) { // [....] } else { if (likely(cpu =3D=3D WORK_CPU_UNBOUND)) add_timer_global(timer); else add_timer_on(timer, cpu); } So when cpu =3D=3D WORK_CPU_UNBOUND the timer is global and is not using a specific CPU. Later, when __queue_work() is called: if (req_cpu =3D=3D WORK_CPU_UNBOUND) { if (wq->flags & WQ_UNBOUND) cpu =3D wq_select_unbound_cpu(raw_smp_processor_id()); else cpu =3D raw_smp_processor_id(); } Because the wq is not unbound, it takes the CPU where the timer fired and enqueue the work on that CPU. The consequence of all of this is that the work can run anywhere, depending on where the timer fired. Recently, a new unbound workqueue specific for long running work has been added: c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works= ") 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/ata/libata-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index f44612e269a4..6733f2b14521 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4753,7 +4753,7 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync) "WARNING: synchronous SCSI scan failed without making any progress= , switching to async\n"); } =20 - queue_delayed_work(system_long_wq, &ap->hotplug_task, + queue_delayed_work(system_dfl_long_wq, &ap->hotplug_task, round_jiffies_relative(HZ)); } =20 --=20 2.53.0