From nobody Sun Feb 8 01:29:43 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D1373328E0; Thu, 23 Oct 2025 14:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229842; cv=none; b=lB2wIhVQ+8oiSZt2FiBLJXLuctkb+Ni6RbDvyzWRqVtpMCf+dxBFrCPt3079s61qAabKPtGkWIs/aEsmejs682HPHRcr4cS2yFoxDWkTVk2LHkTm5DDXERQ9rVwkjLoCOwSWUSlP5uvr/gUyHDqL/SFVM6s9PeByeU+Yjr8B8os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229842; c=relaxed/simple; bh=KKelnfCVSkqGfD/vx5rJBlReymKdSnPUEgmqAjBvnWQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t5CD6ZmjSZXCRNN9ciK1N85cbw+xl58MwKxmXEWv64RTQdpFUzAGcVIETAhAZIw7wUlgo5fbZOsuBHJHzy9HONKTghgslOqrEai0uCD03yYKPzjWq0Dc0XRWAudGKnrE4sAbnyVcwVPh7uQfwIXUoGfK43m+ASeu30lmsScrp+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oaoMS5IW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oaoMS5IW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B0F4C4CEF7; Thu, 23 Oct 2025 14:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761229841; bh=KKelnfCVSkqGfD/vx5rJBlReymKdSnPUEgmqAjBvnWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oaoMS5IWKn09HH1Iw8y4mS8NYzgZ+j+8ai1+ykb2cuEA9dKN6TRAp34bmiSZ2foYZ kvkUd4x46kK5ITscsZGS2nxjTxYCWiPW3b0/sdQaV7PS4o0mNjyj8V+S75fOnRPIwl GTlqompY+aSI5A+7rMfU41iuuW7epavWKCxwTTbKfNFqD/vOSHncyIAKZpH0l/cSWC QbyNgQXgUn2gnnQz74o5cstNQJNrghrCGRNNdUB+oBspT3tPnSWsjtEjAi8oQKzhKG SnjxNRRdQor6OV1otmPBktZvUruprJCzj7DIj4iLuPnf2YRjW3Fem69jfPoHdZM9i2 1qX1nAqqb7Idg== From: Philipp Stanner To: Matthew Brost , Danilo Krummrich , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 1/4] drm/sched: Remove out of place resubmit docu Date: Thu, 23 Oct 2025 16:30:28 +0200 Message-ID: <20251023143031.149496-3-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251023143031.149496-2-phasta@kernel.org> References: <20251023143031.149496-2-phasta@kernel.org> 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" The documentation for drm_sched_backend_ops.run_job() details that that callback can be invoked multiple times by the deprecated function drm_sched_resubmit_jobs(). It also contains an unresolved TODO. It is not useful to document side effects of a different, deprecated function in the docu of run_job(): Existing users won't re-evaluate their usage of the deprecated function by reading the non-deprecated one, and new users must not use the deprecated function in the first place. Remove the out of place documentation. Signed-off-by: Philipp Stanner Acked-by: Danilo Krummrich --- include/drm/gpu_scheduler.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index fb88301b3c45..9c629bbc0684 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -429,16 +429,6 @@ struct drm_sched_backend_ops { * * @sched_job: the job to run * - * The deprecated drm_sched_resubmit_jobs() (called by &struct - * drm_sched_backend_ops.timedout_job) can invoke this again with the - * same parameters. Using this is discouraged because it violates - * dma_fence rules, notably dma_fence_init() has to be called on - * already initialized fences for a second time. Moreover, this is - * dangerous because attempts to allocate memory might deadlock with - * memory management code waiting for the reset to complete. - * - * TODO: Document what drivers should do / use instead. - * * This method is called in a workqueue context - either from the * submit_wq the driver passed through drm_sched_init(), or, if the * driver passed NULL, a separate, ordered workqueue the scheduler --=20 2.49.0 From nobody Sun Feb 8 01:29:43 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62F9F32D433; Thu, 23 Oct 2025 14:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229845; cv=none; b=hZx36E8g0AxOut+DHNEXABFCAKePmz/p7r0Giu9olLaCeLdQOIJAgeqo0ytdO7nvFsMUj4nINuQyWHq+4+c/6tJ9r2yUrVn+sOjn7SEvLl0a96BUm/q9WpTGNHBVjlhWRGrd7xzHCgdEcP9LSPEJgaqoon1lFUSKT9rMvRHbw9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229845; c=relaxed/simple; bh=KCOKaI58Dqzg6Z/GWXMTAoM3n8N68zryV6zLecW4Hg4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kE5O3ECEUVur6y/vBnt99PWUkl8OFRu7Np3y7EeaoqR1N6lZxj1ZNPtc/gYZmfZIWFim2+uenyBLX6LbeHqE6qzcYma1kRnHOsGKQEiNjd9BSdK0TTyPI1Tlae7u/GPKUu9ggltfPVGA5W4357hT02OgRVK3ekSVjP5hGHMRQFc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jx4Dsg5h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jx4Dsg5h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73951C4CEFF; Thu, 23 Oct 2025 14:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761229844; bh=KCOKaI58Dqzg6Z/GWXMTAoM3n8N68zryV6zLecW4Hg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jx4Dsg5h37BhCHR27HmHVAovcAiL6og0kPvboXmWRvUt18NnZBVT4eYiMCflNrSOR nnzbnCrWn35VqVC6Wv61tm/SUBY291w8elnR+nzB5/KBhVSPGgbGlIF9HlqtHmzVDO GpJfQW5uOnLU9IYCeiW7Y50pHZ8eqgj5PL4Wjt6i4nVOCIqZwTKIWKKLDfzEBWHACV j8JCC+/1HyoS0PgWjfBkdM/SOc3/lypCPbBGqGtq27iVfd7Ae07oh5NUefDYqVrip6 ksOKSjyq0e2eSXCtOAuxLNuS1PjdMo9rZQvcg33CySbpyrHT/33E8lIgOP/7Wp/yMc bAuSzPtaxD7oQ== From: Philipp Stanner To: Matthew Brost , Danilo Krummrich , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 2/4] drm/sched: Add a TODO list Date: Thu, 23 Oct 2025 16:30:29 +0200 Message-ID: <20251023143031.149496-4-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251023143031.149496-2-phasta@kernel.org> References: <20251023143031.149496-2-phasta@kernel.org> 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" The DRM GPU scheduler contains a huge number of problems. These should be documented for (new) contributors to pick up work. Add a TODO list with an example entry. Signed-off-by: Philipp Stanner Acked-by: Danilo Krummrich --- drivers/gpu/drm/scheduler/TODO | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 drivers/gpu/drm/scheduler/TODO diff --git a/drivers/gpu/drm/scheduler/TODO b/drivers/gpu/drm/scheduler/TODO new file mode 100644 index 000000000000..79044adb7d01 --- /dev/null +++ b/drivers/gpu/drm/scheduler/TODO @@ -0,0 +1,12 @@ +=3D=3D=3D drm_sched TODO list =3D=3D=3D + +* Example Entry + - Difficulty: hard + - Contact: + - Danilo Krummrich + - Philipp Stanner + - Description: + This is an example. + - Tasks: + 1. Read the example entry. + 2. Remove the entry once solved (never in this case) --=20 2.49.0 From nobody Sun Feb 8 01:29:43 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F121C32D449; Thu, 23 Oct 2025 14:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229848; cv=none; b=sl5ROCShG9t9LdMEsO0XW/X78g4h1Fsb/09RDaUUePDctCadT0xnmFJ4L7lZGGhTJRDI0gPy1rvd844KuBDRe3T9Q7ixFbGKcmu+Bw7xj/WdrfWoMgL1WS8XJxj8RahLELc+IQuD7+po6JiAYCE5XKJlkFvOWUlOa7KemDE3jCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229848; c=relaxed/simple; bh=lRRm98sjHaVsvhoTag39RzQU6GJrENsxxPSr2a2wy8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bPvzbWrQP0Gxgekm2Y3vDTWrUEDapAL8feHjCfvJK0Szdxrz7eQP8zoUQU+QLG3QYsq1SW41S5nNnCMe3asKXPrOdp76RmRUUC5FcgdBERu80cyZwkNxZtDWLGMoJPfRREEtiQ396zujB2EHwa9xHsgZ9B1t7ItFrzBqNtKbKEo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hcQIrwxt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hcQIrwxt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C273C4CEF7; Thu, 23 Oct 2025 14:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761229847; bh=lRRm98sjHaVsvhoTag39RzQU6GJrENsxxPSr2a2wy8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcQIrwxtBlYYrXZf3XUxjvVdQdMgos2eH0AI+i52u4J5Lc9drlw1/M/N5EFNIckEu CVfKOeQgIfvCNx3KK+L4fdwqZlMQNTCWM3c3pPoUk9vPgvroVwz91kH7kLRdvJbAS3 ptr2DoR3CqFoWgTTgroKBzqt2rTsd2QOyDWxrccVjPe9iRHSxxwfPJtbfWEqwy/Ouy RLGbf3buKk4oKus8R0brAGh9sec+F6ShfsbDjKjXwYBSIIkiRRfJsA4Wpcyo7tMV16 BoFzWAm3duA3IWR8/mmhs6toB++A937UsZYTtSwwsdAU1XB3YPm0tNe60+8TDbq3Kz F5Vd/WB9OvGuQ== From: Philipp Stanner To: Matthew Brost , Danilo Krummrich , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 3/4] drm/sched: Add TODO entry for resubmitting jobs Date: Thu, 23 Oct 2025 16:30:30 +0200 Message-ID: <20251023143031.149496-5-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251023143031.149496-2-phasta@kernel.org> References: <20251023143031.149496-2-phasta@kernel.org> 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 Add the issue of a successor of drm_sched_resubmit_jobs() missing to the TODO file. Signed-off-by: Philipp Stanner Acked-by: Danilo Krummrich --- drivers/gpu/drm/scheduler/TODO | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/gpu/drm/scheduler/TODO b/drivers/gpu/drm/scheduler/TODO index 79044adb7d01..713dd62c58da 100644 --- a/drivers/gpu/drm/scheduler/TODO +++ b/drivers/gpu/drm/scheduler/TODO @@ -10,3 +10,29 @@ - Tasks: 1. Read the example entry. 2. Remove the entry once solved (never in this case) + +* GPU job resubmits + - Difficulty: hard + - Contact: + - Christian K=C3=B6nig + - Philipp Stanner + - Description: + drm_sched_resubmit_jobs() is deprecated. Main reason being that it lea= ds to + reinitializing dma_fences. See that function's docu for details. The b= etter + approach for valid resubmissions by amdgpu and Xe is (apparently) to f= igure + out which job (and, through association: which entity) caused the hang= . Then, + the job's buffer data, together with all other jobs' buffer data curre= ntly + in the same hardware ring, must be invalidated. This can for example b= e done + by overwriting it. + amdgpu currently determines which jobs are in the ring and need to be + overwritten by keeping copies of the job. Xe obtains that information = by + directly accessing drm_sched's pending_list. + - Tasks: + 1. implement scheduler functionality through which + the driver can obtain the information which *broken* jobs are currentl= y in + the hardware ring. + 2. Such infrastructure would then typically be used in + drm_sched_backend_ops.timedout_job(). Document that. + 3. Port a driver as first user. + 3. Document the new alternative in the docu of deprecated + drm_sched_resubmit_jobs(). --=20 2.49.0 From nobody Sun Feb 8 01:29:43 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A3FD267714; Thu, 23 Oct 2025 14:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229851; cv=none; b=jYBHtiO/Zgsg3dUR5iID1kpCRo8jBIy26toCAc12BqE59c6rCtTV93PkJN2x5TR+wakBrmlZA1Uln3JWuO61UbIqaJDLKMRHYSOK+HuDyshgAFcSy6Xm5KF7C7tXkNEJOCq5p4E/1k763OwJh8oThRCJIyCiwTHpfV53yRDWVYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229851; c=relaxed/simple; bh=LbOep4u6dGmMx3E06SFB+2sU4wVXqcLPOLAVpCN4zb8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zs4CDaP72j3RjAgsX57+lpSvMQ0pMRT3bf+MQ4WGd0nrxYtM7axeZOQhPH06WhK3Dcw0AGtNAWATY94MRrhdS7ZuJdjXu+Nj8mNu0kPRxMKkHGrFVZTIj7JNUfooAiQ05KzNY6Twb9/NsV/P+pLPHccEY8gczrZG9jXCplb7VCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jxQNZnH1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jxQNZnH1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66FF1C116D0; Thu, 23 Oct 2025 14:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761229850; bh=LbOep4u6dGmMx3E06SFB+2sU4wVXqcLPOLAVpCN4zb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxQNZnH1Iuq3NQom6PZ+X6LwQYE4XRNMIYyz/q4+d+zNT29CuV0rtNMiE7kJGLTSp 58GHiiXK8Dyw74JqZpPaGVsAzD8SReMcho77UlDJ3AmggupP63+XBuUCFGja1pIouk qFbzWbAcnbzagGrd1XNtCbdR2pAAyP+YEe7HHIOAR+FfLCArmDC9aaEOYrqz2XBqZY 1r/8FUTqCjUYqhkjIIBRC2pvALZRoQAfcj4QyDo9XUHHgAvRnmQxQY4R0LeAM46uqK weFuvTqGxYrV8QXS9jylqEQ8veBwmtWYX0TUm6SzdN8TGjXvGp1LjblqHmzrWyBO2I ci9Qk5MX8T5WQ== From: Philipp Stanner To: Matthew Brost , Danilo Krummrich , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , Tvrtko Ursulin Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 4/4] drm/sched: Add TODO entry for missing runqueue locks Date: Thu, 23 Oct 2025 16:30:31 +0200 Message-ID: <20251023143031.149496-6-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251023143031.149496-2-phasta@kernel.org> References: <20251023143031.149496-2-phasta@kernel.org> 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" struct drm_sched_rq is not being locked at many places throughout the scheduler, at least for readers. This was documented in a FIXME added in: commit 981b04d96856 ("drm/sched: improve docs around drm_sched_entity") Add a TODO entry for that problem. Signed-off-by: Philipp Stanner Acked-by: Danilo Krummrich --- drivers/gpu/drm/scheduler/TODO | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/scheduler/TODO b/drivers/gpu/drm/scheduler/TODO index 713dd62c58da..263ce2deb69a 100644 --- a/drivers/gpu/drm/scheduler/TODO +++ b/drivers/gpu/drm/scheduler/TODO @@ -36,3 +36,16 @@ 3. Port a driver as first user. 3. Document the new alternative in the docu of deprecated drm_sched_resubmit_jobs(). + +* Unlocked readers for runqueues + - Difficulty: medium + - Contact: Philipp Stanner + - Description: + There is an old FIXME by Sima in include/drm/gpu_scheduler.h. It detai= ls + that struct drm_sched_rq is read at many places without any locks, not= even + with a READ_ONCE. At XDC 2025 no one could really tell why that is the= case, + whether locks are needed and whether they could be added. (But for rea= l, + that should probably be locked!). + - Tasks: + 1. Check whether locks for runqueue readers can be added. + 2. If yes, add the locks. --=20 2.49.0