From: Philipp Stanner <phasta@mailbox.org>
To: Boris Brezillon <boris.brezillon@collabora.com>,
Steven Price <steven.price@arm.com>,
Liviu Dudau <liviu.dudau@arm.com>,
Akash Goel <akash.goel@arm.com>,
Karunika Choo <karunika.choo@arm.com>,
Lukas Zapolskas <lukas.zapolskas@arm.com>,
Chris Diamand <chris.diamand@arm.com>
Cc: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Philipp Stanner" <phasta@kernel.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
"Xianzhong Li" <xianzhong.li@nxp.com>
Subject: Re: [PATCH] drm/panthor: Skip job dependencies when we can
Date: Tue, 01 Dec 2026 15:09:47 +0100 [thread overview]
Message-ID: <e53389813348fb03d55eb0e4f9a5826f3b4c6981.camel@mailbox.org> (raw)
In-Reply-To: <20261201-panhtor-dep-skip-v1-1-432f313dea0f@collabora.com>
On Tue, 2026-12-01 at 14:58 +0100, Boris Brezillon wrote:
> If a job is passed a dependency that's coming from the same queue the
> job is targeting, we can get rid of the dependency because of the
> implicit serialization provided by the queue.
Shouldn't drm_sched be doing that already? See below.
Am I understanding correctly that someone sets a dependency for
something on the same userspace context, not merely relying on FIFO
behavior?
JobQueue currently is not deadlock-resistant against that because I
expected drivers to ignore such deps.
>
>
[…]
>
> +static bool can_skip_dep(const struct drm_sched_job *job, struct dma_fence *fence)
> +{
> + if (!fence)
> + return true;
> +
> + /* This fence comes from our queue, and the serialization happening at
> + * the queue level makes it so we can skip the CPU wait.
> + */
> + if (fence->context == job->entity->fence_context ||
> + fence->context == job->entity->fence_context + 1)
> + return true;
> +
[…]
> + if (can_skip_dep(job, fence)) {
> + dma_fence_put(fence);
drm_sched does:
static bool drm_sched_entity_add_dependency_cb(struct drm_sched_entity *entity,
struct drm_sched_job *sched_job)
{
struct drm_gpu_scheduler *sched = entity->rq->sched;
struct dma_fence *fence = entity->dependency;
struct drm_sched_fence *s_fence;
if (fence->context == entity->fence_context ||
fence->context == entity->fence_context + 1) {
/*
* Fence is a scheduled/finished fence from a job
* which belongs to the same entity, we can ignore
* fences from ourself
*/
dma_fence_put(entity->dependency);
return false;
}
I seem to be missing something, because at first glance drm_sched
should ignore your added dependencies.
P.
next prev parent reply other threads:[~2026-12-01 14:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 13:58 Boris Brezillon
2026-12-01 14:09 ` Philipp Stanner [this message]
2026-12-01 14:11 ` Tvrtko Ursulin
2026-12-01 14:14 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e53389813348fb03d55eb0e4f9a5826f3b4c6981.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=airlied@gmail.com \
--cc=akash.goel@arm.com \
--cc=boris.brezillon@collabora.com \
--cc=chris.diamand@arm.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=karunika.choo@arm.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=lukas.zapolskas@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=phasta@kernel.org \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=tzimmermann@suse.de \
--cc=xianzhong.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®