Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Matthew Brost <matthew.brost@intel.com>
Cc: "Christian König" <christian.koenig@amd.com>,
	intel-xe@lists.freedesktop.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	thomas.hellstrom@linux.intel.com, sumit.semwal@linaro.org,
	daniel@ffwll.ch
Subject: Re: [PATCH v3 1/2] dma-buf: Split out dma fence array create into alloc and arm functions
Date: Tue, 27 Aug 2024 19:15:59 +0200	[thread overview]
Message-ID: <Zs4Jz0wwC7hGPLR8@phenom.ffwll.local> (raw)
In-Reply-To: <ZsiuvXACGYdm+Ons@DUT025-TGLU.fm.intel.com>

On Fri, Aug 23, 2024 at 03:46:05PM +0000, Matthew Brost wrote:
> On Fri, Aug 23, 2024 at 08:37:30AM +0200, Christian König wrote:
> > Am 23.08.24 um 06:54 schrieb Matthew Brost:
> > > Useful to preallocate dma fence array and then arm in path of reclaim or
> > > a dma fence.
> > 
> > Exactly that was rejected before because it allows to create circle
> > dependencies.
> > 
> 
> Can you explain or do you have link to that discussion? Trying to think
> how this would be problematic and failing to see how it is. 
> 
> > You would need a really really good argument why that is necessary.
> >
> 
> It seems quite useful when you have a code path in which you know N fences
> will be generated, prealloc a dma fence array, then populate at
> later time ensuring no failures points (malloc), and then finally
> install dma fence array in timeline sync obj (chain fences not allowed).
> 
> It fits nicely for VM bind operations in which a device has multple
> TLBs and the TLB invalidation completion is a fence. I suspect Intel
> can't be the only device out their with multiple TLBs, does VM bind, and
> use timeline sync obj.

I think the naming you've picked is a bit confusion, since all you're
splitting out is the kzalloc call. At that point the dma_fence_array isn't
yet useable as a fence, so there's no issues with with circles. It's only
when you call _arm that it becomes a real fence.

I think just renaming _arm to _init, so that we follow the standard naming
pattern for splitting _create() into kzalloc and everything else is all
that's needed here?

Plus updating the kernel doc to make it really clear that _alloc doesn't
give you a fence, just a pile of memory. And that _init must be called
with a compatible amount of fences, or it'll fail.
-Sima
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2024-08-27 17:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  4:54 [PATCH v3 0/2] Replace dma-fence chain with dma-fence array for media GT TLB invalidation Matthew Brost
2024-08-23  4:54 ` [PATCH v3 1/2] dma-buf: Split out dma fence array create into alloc and arm functions Matthew Brost
2024-08-23  6:37   ` Christian König
2024-08-23 15:46     ` Matthew Brost
2024-08-27 17:15       ` Daniel Vetter [this message]
2024-08-23  4:54 ` [PATCH v3 2/2] drm/xe: Use dma-fence array for media GT TLB invalidations in PT code Matthew Brost
2024-08-23  6:40   ` Christian König
2024-08-23 15:38     ` Matthew Brost
2024-08-26  7:43       ` Christian König
2024-08-26  8:45         ` Matthew Brost
2024-08-23  5:04 ` ✓ CI.Patch_applied: success for Replace dma-fence chain with dma-fence array for media GT TLB invalidation Patchwork
2024-08-23  5:04 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-23  5:05 ` ✓ CI.KUnit: success " Patchwork
2024-08-23  5:17 ` ✓ CI.Build: " Patchwork
2024-08-23  5:19 ` ✓ CI.Hooks: " Patchwork
2024-08-23  5:21 ` ✗ CI.checksparse: warning " Patchwork
2024-08-23  5:45 ` ✓ CI.BAT: success " Patchwork
2024-08-23 13:32 ` ✗ CI.FULL: failure " Patchwork

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=Zs4Jz0wwC7hGPLR8@phenom.ffwll.local \
    --to=daniel.vetter@ffwll.ch \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-media@vger.kernel.org \
    --cc=matthew.brost@intel.com \
    --cc=sumit.semwal@linaro.org \
    --cc=thomas.hellstrom@linux.intel.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