All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: Improve reservation object shared slot function
Date: Mon, 24 Sep 2018 17:03:19 +0200	[thread overview]
Message-ID: <20180924150319.GV11082@phenom.ffwll.local> (raw)
In-Reply-To: <20180924115819.2116-1-christian.koenig@amd.com>

On Mon, Sep 24, 2018 at 01:58:12PM +0200, Christian König wrote:
> The reservation object shared slot function only allowed to reserve one slot at a time.
> 
> Improve that and allow to reserve multiple slots to support atomically submission to multiple engines.

I think you can do this already, just don't drop the ww_mutex lock. And I
also think that invariant still holds, if you drop the ww_mutex lock your
fence slot reservation evaporates. Your new code is just a bit more
convenient.

Could we check/enforce this somehow when WW_MUTEX debugging is enabled?
E.g. store the ww_mutex ctx in the reservation (we can dig it out from
under the lock), and then check that the lock holder/ctx hasn't changed
when adding all the fences? I think with multiple fences getting added
atomically some more debug checks here would be good.

Another one: Do we want to insist that you either add all the fences, or
none, to make this fully atomic? We could check this when unlocking the
reservation. Kinda hard to guess what your exact use-case here is.

All this would ofc be compiled out for !WW_MUTEX_DEBUG kernels.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-09-24 15:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 11:58 Improve reservation object shared slot function Christian König
2018-09-24 11:58 ` [PATCH 5/7] drm/amdgpu: always reserve two slots for the VM Christian König
     [not found]   ` <20180924115819.2116-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-24 14:14     ` Michel Dänzer
     [not found] ` <20180924115819.2116-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-24 11:58   ` [PATCH 1/7] dma-buf: remove shared fence staging in reservation object Christian König
2018-09-24 11:58   ` [PATCH 2/7] dma-buf: allow reserving more than one shared fence slot Christian König
2018-09-24 11:58   ` [PATCH 3/7] drm/ttm: allow reserve more than one shared slot Christian König
2018-09-24 14:11     ` Michel Dänzer
2018-09-24 11:58   ` [PATCH 4/7] drm/amdgpu: fix using shared fence for exported BOs Christian König
2018-09-24 11:58   ` [PATCH 6/7] drm/amdgpu: always reserve one more shared slot for pipelines BO moves Christian König
2018-09-24 11:58   ` [PATCH 7/7] drm/ttm: drop the extra reservation " Christian König
2018-09-24 15:03 ` Daniel Vetter [this message]
     [not found]   ` <20180924150319.GV11082-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-09-24 15:16     ` Improve reservation object shared slot function Christian König
     [not found]       ` <b84dbae6-12ce-5632-d80f-567cb7fe678b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-24 15:43         ` Daniel Vetter

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=20180924150319.GV11082@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.