From nobody Sat Feb 7 13:41:39 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 DBF0731D72C; Fri, 7 Nov 2025 13:57:22 +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=1762523844; cv=none; b=YLbrzU9+6vbqvpZ1yeR5XeVBENtR9dQIZ93vV3YY2RjoBqzhOsUWItD1vUBhdABhljqDQxdwxLVFaqVskUNJIJWxFdDHCZkyvi0leb2NZJ0RG7GKzTyzzEIURs+gvl+GEbeNMmC+Olb65IrIT4zn2/vYTAr45JCZrXBYPBe24ZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762523844; c=relaxed/simple; bh=zT7yJtnaqDGXDO589aaFEUqUScUGnxwCLG7F4lbEeTQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AjT9OKJAgeUJvkx4VqI2/6EXoXCt2zfQdEwNNvwqfYCS9rxfFlChCw58mIP4aVCDQyBUBgVgKVxJl7c06/2joPHVRqLsMOIFzSS5zVagJgDNOeiY6UAwpAAZFDvxBfU+LbPH7BSeI+RGXDBgkZcAfcQ3VWaA7zDqBCob1NXTuBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uZ+2Qw+d; 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="uZ+2Qw+d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9F80C19423; Fri, 7 Nov 2025 13:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762523842; bh=zT7yJtnaqDGXDO589aaFEUqUScUGnxwCLG7F4lbEeTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uZ+2Qw+d62NRPggJZhj5nQqWclnslQbXHVlTuBTc5WDnQCVhk0C7xQuNMjMXYsbZr tcg/Kv9BoHfAHNn5q7oxs+3irrVJnGjWlAf9sgOp6cXDuuUGvkDwdLMFG1pTJ744ei E14I92eGwalKkixrWpxnXGNf4NgmnxVj31USHjrt9n/c3OFAmq8V5ncAtjWYgJQRWN Hzgk9AWBYz5o9AntRmhs/4le9FncKlgTSeovjuCeTO8z7YoBOQnpGRHiMsKbUR1Gu1 JA8rz/zeiQ9xISUD8QkI0jD2BAWifSNmL463j99ZaPGjy66jh0LMaRePYpN9duXopZ 7XKHkH5wK/e+A== From: Philipp Stanner To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jonathan Corbet Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Philipp Stanner Subject: [PATCH v2 1/2] drm/todo: Add section with task for GPU scheduler Date: Fri, 7 Nov 2025 14:57:00 +0100 Message-ID: <20251107135701.244659-3-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251107135701.244659-2-phasta@kernel.org> References: <20251107135701.244659-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 Acked-by: Dave Airlie --- Documentation/gpu/todo.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 9013ced318cb..084e148e78c1 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. +4. 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:39 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 90B4D321F5E; Fri, 7 Nov 2025 13:57:25 +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=1762523845; cv=none; b=k+CBvZryU3AitVbwJoTVL8ZQ5yqIWXNwpa2/S+Ns65q4+TpXcEXqUXNdvkxjZN5JRb1kWKpVWD4zh/PPr8Z4EqxxgyUmdL3lNGbx55GtEx04dLg1tZgyqN+XMeFtPbswWQ6+gbFUvdUrNgX07MiW/4G905pNjVz6YG/NsOPws/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762523845; c=relaxed/simple; bh=Z8U/akBsldXiiAXmfTRDia6T57dNa1mxa22yotGMNtI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qVUQkjn3IUfeExLxy1P6FkHp03qeAShkvoVUroDOMxHFKHCMfohauRtGZ1k2Gasf0fNrh9FSjwS+hjQ247BgBLhVLDGm54uefwHNjk7WrzJhZJ5sHd/r8CKOn/3eZakELQOIdSFZUkfKbpFXZeGFdYaWfovPkTduRh/WfRL2J9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=trWAvWOR; 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="trWAvWOR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C81A4C4CEF8; Fri, 7 Nov 2025 13:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762523845; bh=Z8U/akBsldXiiAXmfTRDia6T57dNa1mxa22yotGMNtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=trWAvWOR9eqC8BxkMy6CDLWzGBj9gNBPrMD7XJW4DAu65A0bEzxzvNY3EDq5j8Slc PZ5pg6Nfr11YJHQCZ+JyMWzIBMQs1kYHApIl+vkSCyIF6PHTJPcQY4lwLx8T91eBpI oDElKg2AylMW4SeZoCAvcgiKAVNFL7S1g0575a71DMsVaP0J+KhGcg8cmahb2WUbgS DsMWTd8lPy2KzJalhXpaf8IO9ncfkHQZYiVC6XGULKyLGeyL+IH9LhnQ6fkKX832Jt pQ3HwVqztpAVOUlqbw9zganTTSxsQRpk+WC8RwtKGBpji1yYlZnXhBfqBpuKZ4xC+m 43YAwYv1ungnQ== From: Philipp Stanner To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jonathan Corbet Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Philipp Stanner Subject: [PATCH v2 2/2] drm/todo: Add entry for unlocked drm/sched rq readers Date: Fri, 7 Nov 2025 14:57:01 +0100 Message-ID: <20251107135701.244659-4-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251107135701.244659-2-phasta@kernel.org> References: <20251107135701.244659-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 Acked-by: Dave Airlie --- Documentation/gpu/todo.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 084e148e78c1..fc8bafd593d8 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