From nobody Sun Feb 8 07:58:41 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 94C8141C72 for ; Wed, 24 Dec 2025 14:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587639; cv=none; b=Bf5qDJkZe7QvFYon/dnp8tmUMRh78pVzz5aThPiPi0J4DPeQAyjOMHDvBoJ6m9CImWAsX+oh2Y26V9SCQ6MLyq9mtnQFYmLn1diKSElVpdedKVTRRVPYRK34C/HX0u4FikuFfSAWCiHwu1e+PZXVJyNp1Re4ivwpUI06K2jy/Ls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587639; c=relaxed/simple; bh=bSr2zLEOubTKl+T0amPticnjg8WwHdIskP6g/TilPLc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u1K4yF5s2MzkEeIzOHcO/5/+wXuOFiSmXvx804HPlwRekMAVlsfrEV09lGbBc7PRxdD/yOTGKXmQLg4kMXk7ua6mK1FM7gXjNLkL80Lc1f4OFa2TSUfYwQKpqmBHuXEovoIf0ChmvxClxxxUP0Dmub2nYkDVbw78+aa1Oe7eir0= 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=NaFvhfN6; arc=none smtp.client-ip=209.85.221.41 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="NaFvhfN6" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-42e2e3c0dccso3860072f8f.2 for ; Wed, 24 Dec 2025 06:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1766587636; x=1767192436; 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=Hj0iAOC3x7YMFIhG9hf7cZjPZjj1pyUiQuk+2YzLAvQ=; b=NaFvhfN6A/bGirp0mAU8tB/C4JlcqyrQCtlaHKHPe4IQdvJOqGVFsRX1CDmWAjKV3v 4GRCEqoX5B8P5XfdUtIjmEpefrxrwg7O1Qeqjelfr0FuwIdvUi6gTvBmpd/+/9QJSMjZ iJcnj74+QaheJsBnvfxtwNysmS+TsVQkNu9ca7OVEFO3DPDd2awG6Uv3S3rovj0S7vIx ZU51/LP9Iv2C12IAqu4iZOl52HRotTA9fR5hrJSKhtCDLvUognRHYrpJRiBnZRjid9R6 6pnVQBlNAv1eDkamvtG1o/qiFCBVf5LO/coaV+ew4be6TTwUsu5mOFMqHHpnFLKDyZF7 Bmjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766587636; x=1767192436; 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=Hj0iAOC3x7YMFIhG9hf7cZjPZjj1pyUiQuk+2YzLAvQ=; b=GPKHwKI/dVUZ52aUj7MoGNU2MCGBfIQ4wCZYX8tN0oTj8T5+xZU5zh1c8Wo2qtGHoj vBtMPmRQCmhMIfTXLTb98/r1HERAzatNSmf3p9tY4bMJRBvqn1KwstaG221ly81XlXK+ /uJyMfQYLS0Ok5f8hUeyB4TZLasYuV+KDGQ0j51noSBdQNi/1HzgzSZY4Wyogux9gOoy DJuIaaS4zL6s4L6VRF33vyTOnfGuznffrKfniPKclN8mSXW/1ADPP3yTMelnHM/qLP6u iOFyQ4A3hFAM/xcr8R8p/uPI53kUq7A9b1n9A1G3rjIPF/6SJE+LVWqcq2UIi6Uf7qfI DbGw== X-Gm-Message-State: AOJu0YykjJJOKX3nz3YT2JOJP0sZvzFMy+5K1FuBIeEpXJpgWMlDXM00 R1KjuGLIQDRVOkYuL7fisCeuRVd+7gCPD7X328Qt/utZF9ZueKcRzeogtbGZSP7mok7zIgpY+Q2 RcO0t X-Gm-Gg: AY/fxX4SwKkjSsht/NpqS/e+AVoMtkRLyAxYDErSMrSnC1yj1pSKQyXYlbUcOCuBcGt N4iKitKU8iYMb0Is+Qw9+qOTxi3B65ZSON7dUZSAmwVG3OXiKUChhpR3Kkhk5LXh+zxcHD3PVfe 5x36jskA3kinG2R3RTVctyDPUw6giEbqQD33Zy6/cYdL0cRpXF/NS3A+T9X5b+g/zAIquaBj/co 5AwCx0IZck+T3DLEq6FqiS0hQNq2uhocmnN/kLKGPJ26FJewj7YKtUY98zGY7k7ljRKSa6KYJuT o6vvPoumsj3kSgYXbb90FCyVwfGcMvYELNpPKPkJ/T0MMdFuOtnH4KtRi2G/MLCYV91LvJRB0Bv GwmXSAob9hzi1Bz2a6nEtgDofTrmeL0oRfjnWSYOLIefvSy3Y0zFNAycZWLQdC67rtGVzsYTSkL Y5PaONvd6UUt3KF/R9dg80vxDrUppIdMvtN8s= X-Google-Smtp-Source: AGHT+IF+pEHq8l5EIBnNkchakW8xGfUXFzadra3xxwPBkYTZLxRWsB6KafEKjh9p5ZSsVQDQvBxmXA== X-Received: by 2002:a5d:5f87:0:b0:431:327:5dd4 with SMTP id ffacd0b85a97d-4324e50db43mr19052616f8f.46.1766587635608; Wed, 24 Dec 2025 06:47:15 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43277b82a58sm1041109f8f.6.2025.12.24.06.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Dec 2025 06:47:15 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Alex Deucher , Christian Konig , David Airlie , Simona Vetter , Philip Yang Subject: [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Date: Wed, 24 Dec 2025 15:47:05 +0100 Message-ID: <20251224144708.61167-2-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251224144708.61167-1-marco.crivellari@suse.com> References: <20251224144708.61167-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen after a careful review and conversion of each individ= ual case, workqueue users must be converted to the better named new workqueues = with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/a= mdgpu/aldebaran.c index daa7b23bc775..a7bc65099755 100644 --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c @@ -179,7 +179,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_contr= ol *reset_ctl, list_for_each_entry(tmp_adev, reset_device_list, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work(system_unbound_wq, + if (!queue_work(system_dfl_wq, &tmp_adev->reset_cntl->reset_work)) r =3D -EALREADY; } else diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index 12201b8e99b3..2ee416c36ca3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -6173,7 +6173,7 @@ int amdgpu_do_asic_reset(struct list_head *device_lis= t_handle, list_for_each_entry(tmp_adev, device_list_handle, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { - if (!queue_work(system_unbound_wq, + if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work)) r =3D -EALREADY; } else diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_reset.c index 28c4ad62f50e..9c4631608526 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c @@ -116,7 +116,7 @@ static int amdgpu_reset_xgmi_reset_on_init_perform_rese= t( /* Mode1 reset needs to be triggered on all devices together */ list_for_each_entry(tmp_adev, reset_device_list, reset_list) { /* For XGMI run all resets in parallel to speed up the process */ - if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work)) + if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work)) r =3D -EALREADY; if (r) { dev_err(tmp_adev->dev, --=20 2.52.0 From nobody Sun Feb 8 07:58:41 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 7BF2B22B8AB for ; Wed, 24 Dec 2025 14:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587641; cv=none; b=aOYESnT0uOlSCFOWd2iNiNvJgh9A51kj71iPffSG+ujgzwE7fC+TG73QnUogLAcbwd7iFfVzQTio5ilrUnzFPAkS7KbAEslgDmHz8tZCUVQFs0gTsjhwIoba1gsoH/DIPFALmo/Jf/gnk5P/U6yW+OoclbR6uv+kKOwBJrCA93c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587641; c=relaxed/simple; bh=VkCd39kTQFIuTuF4VgATrRUCW7Ze5pttDXNtdJjvbbU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VL2zxfXfC0LhAFfEm/MJA8G9QTtZRtP9LJO3OMaeaztE9vKsbG0kA4VwUczcAha1WedqKihD+ZWQ126+Z5YHOsTVUbCY/8uKXXfeklvvbOlxdga8vZH9x+4OZ5RXfn0eJZQj97ydYXmhryMNXpyhin0r1VO2nRKrVwgqFDAuEN0= 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=gOLxbkLJ; arc=none smtp.client-ip=209.85.221.42 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="gOLxbkLJ" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-432777da980so110063f8f.0 for ; Wed, 24 Dec 2025 06:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1766587636; x=1767192436; 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=6w04AZ/GEQWzqj88Pa+mb0oh1dp7KzimF/pV3oqQCH4=; b=gOLxbkLJuxi84SIiH804dtCyPUprrImO1zU9MzGXSQ6wIA0qtcxXN2FL8ZqhEEO8IC KyhO7JWt2/JzuuHxbFq/DtNrARXiSvqMIyHZWYlp+6H2wTVbRziTS+Ulhqa+4duOPaa4 sG/9Z6AxC1IKj6Cz+JVP3Ql7JmhJZmFYAWjpjjBHH6RrLZlQLWFkTrrtoQJQQWJtIfVf oF2jniTmfXprrzph2kDYsBzaB7JrYkOfQ0QQ4YNoX6IK5zZe6oYs3QA2IGQA5tF4nu66 Ray1Ury9l1+b7ZgBxueATjQLHyz6fIj61lUsQ+Y4SiuWK8dmStcHC+AwpWMwPcLQYTDo J7mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766587636; x=1767192436; 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=6w04AZ/GEQWzqj88Pa+mb0oh1dp7KzimF/pV3oqQCH4=; b=LHRoB31rJjesarSBMct5vEK0Gm+VjNw38c0apmdY+pW2X/53iClPIdusvKYRbcR7ad 2aSzrMxAbxaVcuZaUJ8h+wFg7LrOdhwXa78D+55zJaxmGVIq2vaSGPYb2YagmhzxUJpe 6DA9FqRWXPC0Tl05YUZZj8tB/eAgFOR+2XPCAom4E5naTG/GwUBB53+w8baL29D3/tTf IDmyjsSsfRbzW+JdMkIk5RHV9ztw0Y3k4Vvkogqgr6eDXaI954u/krID81tddtM63Q/8 gDIA860GXlOCdwXaG4rYjsWyoRHF8U6QXHQ3t6kXMyNB8UhpCJAojGKU84UYVTWH/PIU AsEQ== X-Gm-Message-State: AOJu0YxwrWpC1iTo1cuFdB6Gsr6JcvLu6H1XKLaF19OPpXqu54wNtyWi EB0ARcZEOSj/9Gxb1ocsfEVBGii3Cji4vjpQnH8XXb0W38n4myRy7mRwY9ZOevuNXZwV2GamQRq B3bKj X-Gm-Gg: AY/fxX7saRU0I2rB4DUPiXMchY3We22hf7n9WAK050AOKJnHpvEUCBnofskmwMFTx8F ZNo/oa/iegHIrB4x71GHavpQt7ENWdT709oXv1dwnG/CmLy3Drl0fQpKXAM1Ah6F+7IC8Bhq1hN xSjUV6/OyOUnRstCf/v7SP8cLyzp0FrGeBbBWhPIk4ZBFTUy5jYjE+WqLZhbOddFQMITEmk+hEZ CtjyiIRXLRb0hHS1Vuam6TLfCGjL/twWArv0u1u5wfZv7S/zOlYxTtPU794BvBDm+kB4tIEiTbQ LivWOEKm/fw5nZovo3N6i/EtKZJsQ050T8m/kr56DU/yXznFO2eeAaorJTSYybh/DE8BjZ0Via5 ONaG0AGApRKJSSQylGhi0ae1x/r0XFXGrsbl3CY3o/jFTBZRneecbq99D5cSGqUM5ORM2hKh+PI TRqJ/XgPru5hTxtCXf6EeK5c1Fb4ljVORoack= X-Google-Smtp-Source: AGHT+IGKZi6YAgPE4JJhdvYtojB16190r8/FC+SNzbAvU1yoHdGoqLUIdHV5gz4Ie0QCP7z4X1I3Vg== X-Received: by 2002:a05:6000:1acc:b0:431:327:5dc2 with SMTP id ffacd0b85a97d-4324e50a6acmr21001602f8f.51.1766587636479; Wed, 24 Dec 2025 06:47:16 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43277b82a58sm1041109f8f.6.2025.12.24.06.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Dec 2025 06:47:16 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Alex Deucher , Christian Konig , David Airlie , Simona Vetter , Philip Yang Subject: [PATCH v3 2/4] drm/amdgpu: replace use of system_wq with system_dfl_wq Date: Wed, 24 Dec 2025 15:47:06 +0100 Message-ID: <20251224144708.61167-3-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251224144708.61167-1-marco.crivellari@suse.com> References: <20251224144708.61167-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch continues the effort to refactor workqueue APIs, which has begun with the changes introducing new workqueues and a new alloc_workqueue flag: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The point of the refactoring is to eventually alter the default behavior of workqueues to become unbound by default so that their workload placement is optimized by the scheduler. Before that to happen after a careful review and conversion of each individ= ual case, workqueue users must be converted to the better named new workqueues = with no intended behaviour changes: system_wq -> system_percpu_wq system_unbound_wq -> system_dfl_wq This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index 2ee416c36ca3..39170c04a519 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4922,7 +4922,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, } /* must succeed. */ amdgpu_ras_resume(adev); - queue_delayed_work(system_wq, &adev->delayed_init_work, + queue_delayed_work(system_dfl_wq, &adev->delayed_init_work, msecs_to_jiffies(AMDGPU_RESUME_MS)); } =20 @@ -5469,7 +5469,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool= notify_clients) if (r) goto exit; =20 - queue_delayed_work(system_wq, &adev->delayed_init_work, + queue_delayed_work(system_dfl_wq, &adev->delayed_init_work, msecs_to_jiffies(AMDGPU_RESUME_MS)); exit: if (amdgpu_sriov_vf(adev)) { --=20 2.52.0 From nobody Sun Feb 8 07:58:41 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 6545F329E72 for ; Wed, 24 Dec 2025 14:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587641; cv=none; b=YMVUEojRFpTDVBza3Z3I5ExqlJ291jZz+ZeUkm38ojXQGY2orWf0RyNAv9x8oxRFxtcEphOSTv38/rse+Ho9Yp0Msdzo/yKKPjJoIuOkMo1VIcigBrubClopro0lKCSVMbcs3kC5NXyJ2sNYBNk78XMkXNDfmZskqp53qmUAISc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587641; c=relaxed/simple; bh=07pRa7fMzsJKLk5usxvbTFXFTIga7XNAtYPREw+e9G8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=taKU7a+kp3gwUwmbL4BpNdcssQx4n4DPYc/8hlXLqvYXsQMeWZIKCwMmihWHkkaBFDSX47z257j5KLM+eQuv1ouDYPqqFmtIIyCu+rUsckMEBeYs0tCIujUOSdEZmxvGW4YDlf2SBiiD5z3vvXfDwYh/jeorlOTZFliMRi78Mic= 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=QDqrbFHz; arc=none smtp.client-ip=209.85.221.41 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="QDqrbFHz" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-42fbc305552so4916219f8f.0 for ; Wed, 24 Dec 2025 06:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1766587637; x=1767192437; 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=/n2N4LnmCtF9W2G5kEXd8AwOxl6hnhqTX0TO2AWbjcs=; b=QDqrbFHzpHBk2xuE9EtT/RrojuryBOGEnPHLNscdlS9QG6uQpMtRE7BXdcrU6HesZz EaZMjw29qnp6Plw7ik/xGk/6b6j/SmR4pA3yJgSNh7x/6vebBrQ0ADE9ItrH2LamYjlb SnrNUtwiA+6WOhngce/Nd10Wb4rRvhIzJ2q3dPggMqLiLnHOLrCQUb4VOV9a3PZ3BC51 QuNP0qTIEBE5Vu1kg7F8eMWwAT03alNcPJlcAATHymFnetGbfr6yKh1EM9TIEi5RAxJC Gn0jluUc5j+qOYvrLL5OKsR+kFC6t5q5IQVljOZ6eKssPjBgvH44curGyUuM8KJaC7vo 9QqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766587637; x=1767192437; 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=/n2N4LnmCtF9W2G5kEXd8AwOxl6hnhqTX0TO2AWbjcs=; b=gXJwSv3h5J/22RHu96f6a4VcKH+rVPbNV/9Wn+tRAtISm+/0rCNGrfrX2BX3MdQAop 1KjUoC8Udw4ldBt03nIAfJNIj6TTq8x0E3qj7OImfSGnQG7/8UOHn+Y7BQBzZA/VgOmV RbSRgsJHC91+020fltK+gDzHvbJd4sywmSMc5AkxXP/Eo1Ap4LopkSgTFUWk94NP5ze8 FmPKSy8TszPgzGJ6fneUzYFTbJTzecIcxCb8B8bojDq+SrQeShVVHNL0Gp5nUjNQoyDP Ytu51yfjIwMf0BICSfPhTYgbB/JOhiKUATbadBx7zY+jLd7Vx1IZiZqqWHdikecNukIc dnWQ== X-Gm-Message-State: AOJu0YxEr1job91sX6Hc1YYz+m1e8X4iV6zNWfPGckkisIHe6oYw5I6+ V8yvjIKSXBhbyR+bD5AXa56+u59jI9nX/Pp6PIz5CCEeeadCWYbBiLUpugOlpEcbh1b2nPYt0VT Px7nd X-Gm-Gg: AY/fxX5FiSRxa5I6+aukMpf9O/Lq42q/59dgDEl70tQ+TrnGacdl9OnzwGQo4TpB62r N1corwOvWxw5DeGhsQBZHgQOA5aUlxukA6j8I3h+lP3XopFstSH0V+o5kOPAZix+yDlAKYCMSNp 5+QvYt+0i9B1gDwwNwFA2wGBSOU4baOrzXmIrU1h0pUN+aAO0XiBuruoGGfbxNYu2zTgm1XZHIX IlWw6UiL9PElNHb9XZNfLMzoCwgojC/hBTT6SfFSa60O3XEamQ9tY3aviWYiCVx15+5cvnna8sM lrZZQlxFBa7RN6Ny2zaf9GDStQORpSEjsMXMLgx/fjomR/U6FPeZGGQ04vciwMXFuoZVHEG4eeB THF/KSBOCKoWAVrfKzUbUm/3kbxtOeM4IHDlVaUUPk6714AZPvqUf/3sq03fxA2JK8r2GwF6Wmh IcQInUaub4v0SZNn03LCzItXcClc+IChfy+gs= X-Google-Smtp-Source: AGHT+IGBgdmlFeZGuAraEKzTOnYGzJONLAgugomtD+mpTKl8xRyC02+N053pGm6O+M5QjGZJai8psw== X-Received: by 2002:a5d:58e9:0:b0:432:5b81:480 with SMTP id ffacd0b85a97d-4325b810a80mr11186649f8f.24.1766587637437; Wed, 24 Dec 2025 06:47:17 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43277b82a58sm1041109f8f.6.2025.12.24.06.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Dec 2025 06:47:17 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Alex Deucher , Christian Konig , David Airlie , Simona Vetter , Philip Yang Subject: [PATCH v3 3/4] amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users Date: Wed, 24 Dec 2025 15:47:07 +0100 Message-ID: <20251224144708.61167-4-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251224144708.61167-1-marco.crivellari@suse.com> References: <20251224144708.61167-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: quoted-printable This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The refactoring is going to alter the default behavior of alloc_workqueue() to be unbound by default. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn=E2=80=99t explicitly specify WQ_UNB= OUND must now use WQ_PERCPU. For more details see the Link tag below. This specific workload has no benefit being per-cpu, so its behavior has been changed using explicitly WQ_UNBOUND. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd= /amdkfd/kfd_process.c index a085faac9fe1..5ecdb338b390 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -690,7 +690,8 @@ void kfd_procfs_del_queue(struct queue *q) int kfd_process_create_wq(void) { if (!kfd_process_wq) - kfd_process_wq =3D alloc_workqueue("kfd_process_wq", 0, 0); + kfd_process_wq =3D alloc_workqueue("kfd_process_wq", WQ_UNBOUND, + 0); if (!kfd_restore_wq) kfd_restore_wq =3D alloc_ordered_workqueue("kfd_restore_wq", WQ_FREEZABLE); --=20 2.52.0 From nobody Sun Feb 8 07:58:41 2026 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 5A2DB33B6E0 for ; Wed, 24 Dec 2025 14:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587642; cv=none; b=tWC2RXHxY88Zg2Nb4rrRRnencPO7wj1dK/zcOuitMdV5DCAVrw/nG4tXHYwHYmh7OmQKsBJVvFaEohG8HoLHR26Yj3RHzHLHkDFoxuYAqxAyRFPatbMHNjfRjtofoj1sKVHNlZ0MGhS5RoZTK3/RruNFSP5j9wIClblbqZYcMkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766587642; c=relaxed/simple; bh=Ra63+43BU0Us+7YravPsiDvqeL3Hk7Miz8uduIUJvRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fu9gYatxNxYgCRAj0eb7SPFBDRtMEGMnV9bHZKmmdIjk3vh1w7doOJbhN8LZ+a5pBXvRrSBnRg6rT9p8yUinZ5iDW98JjemsAVnMUKf8RkFRnklAVEDXTE/8sXnkPvuPbZUfan3ZY8GNcw/u75HAfL+x3jpfI8lOc4rWUmGQwSE= 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=BID5SpOd; arc=none smtp.client-ip=209.85.221.51 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="BID5SpOd" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-42fb4eeb482so3073355f8f.0 for ; Wed, 24 Dec 2025 06:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1766587638; x=1767192438; 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=EusSFmSFHvXdK2TABmwbfVXk8QB5nq86ggI4VdbsACk=; b=BID5SpOdkT3WqrIzORJVwb3Bhbm3jifxg/FQmCIyhS5oFt/t5kwojwexGA5FYpY6cT 9Rv4pxpugOcZV8U09X4HUKZXd2ES3REK503Ue3G0QBCG8ZHH7IPj+TRFZCRx4hjGvqsD CL3SQVoLLUSqDV4E6BIp8BMjoYrIwV/j9VVXeDpkMacQCIuVDGW2TIixywpVglMwm2mQ ujWW8DQIWR538v2htyQ6apTLFTYcRk1ylwvk8ADG2PYngTGLmRHRA+DFGZqQvrsnRc3Z Th7/1hUtwl3SrTrXWN0fg5LxAuueF6rECazrecGt5XcURjMYDqEk1RHFg8zD0xBwYLMI ZxYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766587638; x=1767192438; 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=EusSFmSFHvXdK2TABmwbfVXk8QB5nq86ggI4VdbsACk=; b=dNi6AAhBaRtIp1GbofMCYPGAz+N24IJeVb5Q4T21wvz9gzXmJtheoT45/sLl71RbrH dwzTf3ao37cBYPx3760i3oyyQ4CsifdV50L5dTgCUFLQpgjVv2h/C1bofgjYeV4NJRZq EU/mRZsbn62MD4bYU3swnrKOyU/gGtXEzKcS1locXZQZURGwi+8Lf0/kRaFL1nAjuicz JR9znuZ5VGmfJ7+/Pt4xtGyvGI0fOWQNLjQSUUgjgnn9lfvddVkVKfF/MsYtfuUtdyr0 zRJ7mF6ws0h0638q2EJkiiB46+FGS8qT9Juw1BVcJzFIa9fmtCRYRGwhA1wSzLjarwei rMmw== X-Gm-Message-State: AOJu0YwYFsBEtKRBu9dZzKtTrxRYT7uWJHa+kYO2TsVpXrpDexXyJUfF eCSMy53BFVzLhc5yJZvTzefSArnEku7F6QFnKrtdFjwq4mNZp4J7g3Rb751wcpqgrMiHkZGxv+L ecVV6 X-Gm-Gg: AY/fxX7UOMA9Xm2r8ikQFH0q3o9pdPqWh0bm7LJqQesSEmLdhOrbQl5kO+WthIu7T4+ /03aBUv+nZIfcJH+ua1oq79c+VxpTE24rzQd5XhSnM22yGN6VymbRkTv9TGbGcicsUvlx9wSngp FDEot5ryRjKTMr46OdX2LIvt0WwQN8ZkTUCkhLqTsUl6HGYaIqcspaput6E61ol5B1VAnTscTv+ uwDBKGT/kSE+HmFYwlw2Y7VotnTYpZxXca4NuDpJHXDYl9mX2QJ6dfZPy3miL7w7gA5ewW55axL SZTWqvmMvIGMtotBnZjqIKv4IIkDfW1atphyiCIlg9Wbia0q9hy9QXosf9TBoZMCIMAALjPOAj7 HoufIy6zjMEwONrJ5ioklTgbRC6aMdg4ajNnq6i19AMcHSbd+BsxjXQZSovQnuRCmW4LIQ/LAMr SYIk6S+Szoluu60JGhi8cQ5jzXlSCbyWNQ6EI= X-Google-Smtp-Source: AGHT+IGJt/mwYM0l80VTHl5jzogHkpHFpfjU/vUbSjbHEQ65UEFCA++BEt+L9cJZpI26+VHKaAJNzg== X-Received: by 2002:a05:6000:220c:b0:42f:b65c:1e4f with SMTP id ffacd0b85a97d-4324e4c97ccmr18106758f8f.17.1766587638414; Wed, 24 Dec 2025 06:47:18 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43277b82a58sm1041109f8f.6.2025.12.24.06.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Dec 2025 06:47:18 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Alex Deucher , Christian Konig , David Airlie , Simona Vetter , Philip Yang Subject: [PATCH v3 4/4] drm/radeon: add WQ_PERCPU to alloc_workqueue users Date: Wed, 24 Dec 2025 15:47:08 +0100 Message-ID: <20251224144708.61167-5-marco.crivellari@suse.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251224144708.61167-1-marco.crivellari@suse.com> References: <20251224144708.61167-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: quoted-printable This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") The refactoring is going to alter the default behavior of alloc_workqueue() to be unbound by default. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn=E2=80=99t explicitly specify WQ_UNB= OUND must now use WQ_PERCPU. For more details see the Link tag below. In order to keep alloc_workqueue() behavior identical, explicitly request WQ_PERCPU. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/gpu/drm/radeon/radeon_display.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/rade= on/radeon_display.c index 35fb99bcd9a7..99a3e4c480c1 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -685,7 +685,8 @@ static void radeon_crtc_init(struct drm_device *dev, in= t index) if (radeon_crtc =3D=3D NULL) return; =20 - radeon_crtc->flip_queue =3D alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0); + radeon_crtc->flip_queue =3D alloc_workqueue("radeon-crtc", + WQ_HIGHPRI | WQ_PERCPU, 0); if (!radeon_crtc->flip_queue) { kfree(radeon_crtc); return; --=20 2.52.0