Re: [Intel-gfx] [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access"

2016-11-29 Thread Chris Wilson
On Tue, Nov 29, 2016 at 08:51:02AM +, Tvrtko Ursulin wrote:
> 
> On 28/11/2016 14:36, Chris Wilson wrote:
> >This reverts commit 27745e829a5c ("drm/i915/execlists: Use a local lock
> >for dfs_link access") as the struct_mutex was required to prevent
> >concurrent retiring and freeing, now restored in the previous patch.
> >
> >Signed-off-by: Chris Wilson 
> >Cc: David Weinehall 
> >Cc: Tvrtko Ursulin 
> Reviewed-by: Tvrtko Ursulin 

Pushed this pair. Revisiting the struct_mutex requirement here is a
possibility. Just need to remember the issue with cross-engine retires.
Will also be a factor in lifting this, or a similar, scheme to dma-buf.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access"

2016-11-29 Thread Tvrtko Ursulin


On 28/11/2016 14:36, Chris Wilson wrote:

This reverts commit 27745e829a5c ("drm/i915/execlists: Use a local lock
for dfs_link access") as the struct_mutex was required to prevent
concurrent retiring and freeing, now restored in the previous patch.

Signed-off-by: Chris Wilson 
Cc: David Weinehall 
Cc: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/intel_lrc.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 0a09024d6ca3..b2c0d509e191 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -695,7 +695,6 @@ pt_lock_engine(struct i915_priotree *pt, struct 
intel_engine_cs *locked)

 static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
 {
-   static DEFINE_MUTEX(lock);
struct intel_engine_cs *engine = NULL;
struct i915_dependency *dep, *p;
struct i915_dependency stack;
@@ -704,8 +703,8 @@ static void execlists_schedule(struct drm_i915_gem_request 
*request, int prio)
if (prio <= READ_ONCE(request->priotree.priority))
return;

-   /* Need global lock to use the temporary link inside i915_dependency */
-   mutex_lock();
+   /* Need BKL in order to use the temporary link inside i915_dependency */
+   lockdep_assert_held(>i915->drm.struct_mutex);

stack.signaler = >priotree;
list_add(_link, );
@@ -772,8 +771,6 @@ static void execlists_schedule(struct drm_i915_gem_request 
*request, int prio)
if (engine)
spin_unlock_irq(>timeline->lock);

-   mutex_unlock();
-
/* XXX Do we need to preempt to make room for us and our deps? */
 }




Reviewed-by: Tvrtko Ursulin 

Regards,

Tvrtko
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx