From: Matthew Brost <matthew.brost@intel.com>
To: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
phasta@mailbox.org, alexdeucher@gmail.com,
simona.vetter@ffwll.ch, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 01/15] dma-buf: cleanup dma_fence_describe
Date: Wed, 22 Oct 2025 20:45:21 -0700 [thread overview]
Message-ID: <aPmk0azjXFqGMpfi@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <c32fa361-9331-4cc6-a155-33cc6339038b@ursulin.net>
On Tue, Oct 14, 2025 at 03:37:03PM +0100, Tvrtko Ursulin wrote:
>
> On 13/10/2025 14:48, Christian König wrote:
> > The driver and timeline name are meaningless for signaled fences.
> >
> > Drop them and also print the context number.
> >
> > Signed-off-by: Christian König <christian.koenig@amd.com>
> > ---
> > drivers/dma-buf/dma-fence.c | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> > index 3f78c56b58dc..f0539c73ed57 100644
> > --- a/drivers/dma-buf/dma-fence.c
> > +++ b/drivers/dma-buf/dma-fence.c
> > @@ -1001,17 +1001,18 @@ void dma_fence_describe(struct dma_fence *fence, struct seq_file *seq)
> > {
> > const char __rcu *timeline;
> > const char __rcu *driver;
> > + const char *signaled = "un";
> > rcu_read_lock();
> > timeline = dma_fence_timeline_name(fence);
> > driver = dma_fence_driver_name(fence);
> > - seq_printf(seq, "%s %s seq %llu %ssignalled\n",
> > - rcu_dereference(driver),
> > - rcu_dereference(timeline),
> > - fence->seqno,
> > - dma_fence_is_signaled(fence) ? "" : "un");
> > + if (dma_fence_is_signaled(fence))
> > + timeline = driver = signaled = "";
>
> FWIW you could avoid calling dma_fence_timeline_name() and
> dma_fence_driver_name() since you added the signaled check.
>
+1 to avoid calling dma_fence_timeline_name / dma_fence_driver_name on
signaled fences.
Matt
> May end up slightly nicer than to override strings returned from helpers
> with a chained assignment.
>
> Or even store the signaled status in a local bool and branch off two
> seq_printfs based on it.
>
> > +
> > + seq_printf(seq, "%llu %s %s seq %llu %ssignalled\n", fence->context,
> > + timeline, driver, fence->seqno, signaled);
>
> I was initially worried if this string ends up anywhere which could be
> considered ABI but it seems debugfs only so changing the formatting is fine.
>
> How about making dma_fence_describe() conditional on CONFIG_DEBUG_FS to set
> this in stone? (And dma_resv_describe..)
>
> And maybe unify the %llu:%llu context:fence as the tracepoints use?
>
> Altogether something like:
>
> rcu_read_lock();
>
> signaled = dma_fence_is_signaled(fence);
>
> if (signaled)
> seq_printf("%llu:%llu %s %s signalled",
> fence->context,
> fence->seqno,
> dma_fence_timeline_name(fence),
> dma_fence_timeline_name(fence);
> else
> seq_print("%llu:%llu unsignalled",
> fence->seqno, fence->context);
>
> Maybe more readable but up to you.
>
> Regards,
>
> Tvrtko
> > rcu_read_unlock();
> > }
>
next prev parent reply other threads:[~2025-10-23 3:45 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 13:48 Independence for dma_fences! Christian König
2025-10-13 13:48 ` [PATCH 01/15] dma-buf: cleanup dma_fence_describe Christian König
2025-10-14 14:37 ` Tvrtko Ursulin
2025-10-23 3:45 ` Matthew Brost [this message]
2025-10-13 13:48 ` [PATCH 02/15] dma-buf: rework stub fence initialisation Christian König
2025-10-14 15:03 ` Tvrtko Ursulin
2025-10-24 7:29 ` Tvrtko Ursulin
2025-10-13 13:48 ` [PATCH 03/15] dma-buf: protected fence ops by RCU Christian König
2025-10-16 18:04 ` Tvrtko Ursulin
2025-10-31 10:35 ` Tvrtko Ursulin
2025-10-13 13:48 ` [PATCH 04/15] dma-buf: detach fence ops on signal Christian König
2025-10-16 8:56 ` Tvrtko Ursulin
2025-10-16 15:57 ` Tvrtko Ursulin
2025-10-23 4:23 ` Matthew Brost
2025-10-23 4:44 ` Matthew Brost
2025-10-30 13:52 ` Christian König
2025-10-31 10:31 ` Tvrtko Ursulin
2025-10-17 9:14 ` Philipp Stanner
2025-10-30 15:05 ` Christian König
2025-10-13 13:48 ` [PATCH 05/15] dma-buf: inline spinlock for fence protection Christian König
2025-10-16 9:26 ` Tvrtko Ursulin
2025-11-03 13:07 ` Philipp Stanner
2025-10-23 18:09 ` Matthew Brost
2025-10-30 15:14 ` Christian König
2025-10-13 13:48 ` [PATCH 06/15] dma-buf: use inline lock for the stub fence Christian König
2025-10-13 13:48 ` [PATCH 07/15] dma-buf: use inline lock for the dma-fence-array Christian König
2025-10-13 13:48 ` [PATCH 08/15] dma-buf: use inline lock for the dma-fence-chain Christian König
2025-10-13 13:48 ` [PATCH 09/15] drm/sched: use inline locks for the drm-sched-fence Christian König
2025-10-13 13:48 ` [PATCH 10/15] drm/amdgpu: fix KFD eviction fence enable_signaling path Christian König
2025-10-13 13:48 ` [PATCH 11/15] drm/amdgpu: independence for the amdgpu_fence! Christian König
2025-10-13 13:48 ` [PATCH 12/15] drm/amdgpu: independence for the amdgpu_eviction_fence! Christian König
2025-10-13 13:48 ` [PATCH 13/15] drm/amdgpu: independence for the amdgpu_vm_tlb_fence! Christian König
2025-10-13 13:48 ` [PATCH 14/15] drm/amdgpu: independence for the amdkfd_fence! Christian König
2025-10-17 22:22 ` Felix Kuehling
2025-10-30 15:07 ` Christian König
2025-10-30 20:04 ` Felix Kuehling
2025-10-13 13:48 ` [PATCH 15/15] drm/amdgpu: independence for the amdgpu_userq__fence! Christian König
2025-10-13 14:54 ` Independence for dma_fences! Philipp Stanner
2025-10-14 15:54 ` Christian König
2025-10-17 8:32 ` Philipp Stanner
2025-10-28 14:06 ` Christian König
2025-10-29 20:53 ` Matthew Brost
2025-10-30 10:59 ` Christian König
2025-10-31 17:44 ` Matthew Brost
2025-11-03 11:43 ` Christian König
2025-11-03 19:32 ` Matthew Brost
2025-10-15 0:51 ` Dave Airlie
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=aPmk0azjXFqGMpfi@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=phasta@mailbox.org \
--cc=simona.vetter@ffwll.ch \
--cc=tursulin@ursulin.net \
/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