From nobody Sat Feb 7 13:41:32 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 58C8A2E8B9C; Fri, 31 Oct 2025 12:00:35 +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=1761912036; cv=none; b=ob0XPPpv1puE+fCVFoBm5JJ/En0hwWxDpdxjVTyKBf5HM1GpQfx2gfHJ1ThnM1zP/pft8R/mfrGBgwrCk190wXm1N4u5y+glRB+8gt5HVmeXD2cT4L7D5JnuVINgLiVEHFga3qNxDw5S1EmyiS7JZerLhzmhGK06JaEQc71rmws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761912036; c=relaxed/simple; bh=SDd4mBlkeUTWsBdfubSSDSqZM77oOIAxyGbT/JP1GFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VTVeMyQZAV7AjzluFF0SnvjCN/Uh5V8CzeISQZVfLd2wywA44IGiTCBHcbsY7rktjYN3wzyZ74cyILORp+8Wof1Iapw2HPQhPM0X1thbtA9RvWW77bdekgG1wFtgCFcSmwcr/83cbVpg4qMWJBvh84N1+hkKdlRm8X3u/te96DE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qsccBlWM; 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="qsccBlWM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6DA7C4CEF8; Fri, 31 Oct 2025 12:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761912035; bh=SDd4mBlkeUTWsBdfubSSDSqZM77oOIAxyGbT/JP1GFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qsccBlWMTPUGQq8CJm55Gja33/YFqV6mSTDFyl0r5aRN8rBkkJChCsiAjHINOPdOT E19EKKzKxtxwl5Q2IJ935/4Xxk8fwA2uEG7T//OOgug1BvcPQctfeQaKw3exIvIb/l hX8vFzYc8jq4oK+wHcm2GOr3L3IPDHCqTr6LKwLbUoTfEqN0iDCiHVCA+EaQlWvsoP AXV8iiJ6QMj+9n4h1FAAH06r/3MgLnTvPA15Vs8gYB88TfKZRFNup2r/JGHk+4KM6N VJNBjgjDOC8L9Q5iA9dZIR9ynNgj/5VGBu70ACLxg+CvofEvz1yiIfThqp64auvRTQ jbb8TpvQn+u8Q== From: Philipp Stanner To: David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jonathan Corbet Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Philipp Stanner Subject: [PATCH 1/2] drm/todo: Add section with task for GPU scheduler Date: Fri, 31 Oct 2025 13:00:14 +0100 Message-ID: <20251031120014.248416-3-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251031120014.248416-2-phasta@kernel.org> References: <20251031120014.248416-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 The GPU scheduler has a great many problems and deserves its own TODO section. Add a section and a first task describing the problem of drm_sched_resubmit_jobs() being deprecated without a successor. Signed-off-by: Philipp Stanner --- Documentation/gpu/todo.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 9013ced318cb..835e799ddfe2 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -878,6 +878,37 @@ Contact: Christian K=C3=B6nig =20 Level: Starter =20 +DRM GPU Scheduler +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Provide a universal successor for drm_sched_resubmit_jobs() +------------------------------------------------------------ + +drm_sched_resubmit_jobs() is deprecated. Main reason being that it leads to +reinitializing dma_fences. See that function's docu for details. The better +approach for valid resubmissions by amdgpu and Xe is (apparently) to figur= e out +which job (and, through association: which entity) caused the hang. Then, = the +job's buffer data, together with all other jobs' buffer data currently in = the +same hardware ring, must be invalidated. This can for example be 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 informatio= n by +directly accessing drm_sched's pending_list. + +Tasks: + +1. implement scheduler functionality through which the driver can obtain t= he + information which *broken* jobs are currently 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(). + +Contact: Christian K=C3=B6nig + Philipp Stanner + +Level: Advanced + Outside DRM =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.49.0 From nobody Sat Feb 7 13:41:32 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 D72C233E352; Fri, 31 Oct 2025 12:00:38 +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=1761912038; cv=none; b=pRsStxIZJW0fuuvU58QYCN9vjHLfqZRhaNxQXxmbahE7kVl8z49VhwYW2Qx0B9Yb2Eba69htOEEWDCoOV8zkKmqz8GDD+Xi+1GbInLvLqdCr9ktX1hZ7NqS4sSqC0vDihdOLECMX7/cjndkOb42THc/qAp/MQbKG94M1Q5RXN+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761912038; c=relaxed/simple; bh=5Y2K69DPuTxufr2/30uL7COrThaw9oWJXaibDgLkv3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TFJRfG9zAQeLRidrG57NvcOnBjgHwFPgZceeDNFh/NpGYSFXIpBaEKGKriZM3AF3xD2ECm/QNCLknaFowz8W9XWhBH6AmWC9ZEj7OkTS4UXkzJ7EbIen8Hc+6bB6bSyOyJMsieQRnST0lHxyJ62Aqmjb2SX+PHAzBAEfwDKr0vw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vEUTepPw; 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="vEUTepPw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B5CFC4CEFB; Fri, 31 Oct 2025 12:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761912038; bh=5Y2K69DPuTxufr2/30uL7COrThaw9oWJXaibDgLkv3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vEUTepPwhkQmpxfK8CEXqfwhXgYhIcPm7nNen+UsWtqrisuiz5Peyp5WXllkTGtLs J4Jc4g7fyHIII5OnqUtgmB/NFzNUsXHDAJuNR0PYwGMIiEogZz62hWd+xR42vFW02A HJbM29Zgy8cdeC3XtjFVcNCzum2H87VpT3TK/vA+7obu12IZgwJVD1mlqt8KyVisXJ wje2R340p3eZNFfpUfDsVdYqtRJzxgY65Me5QsT5tkygf3+zUxV+2CTHMHybHAK53V vMvkJNaaC4lwGb8NO1npdlC1mGOGwAntkZBZ0+BuGwum2RuqSrQvYxaMjuuRzV+REP Dbk+q+MujeA/g== From: Philipp Stanner To: David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jonathan Corbet Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Philipp Stanner Subject: [PATCH 2/2] drm/todo: Add entry for unlocked drm/sched rq readers Date: Fri, 31 Oct 2025 13:00:15 +0100 Message-ID: <20251031120014.248416-4-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251031120014.248416-2-phasta@kernel.org> References: <20251031120014.248416-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 Runqueues are currently almost everywhere being read unlocked in drm/sched. At XDC 2025, the assembled developers were unsure whether that's legal and whether it can be fixed. Someone should find out. Add a todo entry for the unlocked runqueue reader problem. Signed-off-by: Philipp Stanner --- Documentation/gpu/todo.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 835e799ddfe2..7d7e9e3741e9 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -909,6 +909,20 @@ Contact: Christian K=C3=B6nig =20 Level: Advanced =20 +Add locking for runqueues +------------------------- + +There is an old FIXME by Sima in include/drm/gpu_scheduler.h. It details t= hat +struct drm_sched_rq is read at many places without any locks, not even wit= h a +READ_ONCE. At XDC 2025 no one could really tell why that is the case, whet= her +locks are needed and whether they could be added. (But for real, that shou= ld +probably be locked!). Check whether it's possible to add locks everywhere,= and +do so if yes. + +Contact: Philipp Stanner + +Level: Intermediate + Outside DRM =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.49.0