All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Move priority bumping for flips earlier
@ 2016-11-28 14:36 Chris Wilson
  2016-11-28 14:36 ` [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access" Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2016-11-28 14:36 UTC (permalink / raw)
  To: intel-gfx

David found another issue with priority bumping from mmioflips, where we
are accessing the requests concurrently to them being retired and freed.
Whilst we are skipping the dependency if has been submitted, that is not
sufficient to stop the dependency from disappearing if another thread
retires that request. To prevent we can either employ the struct_mutex (or a
request mutex in the future) to serialise retiring before it is freed.
Alternatively, we need to keep the dependencies alive using RCU whilst
they are being accessed via the DFS.

Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698111] general protection fault: 0000 [#1] PREEMPT SMP
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698305] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698750] CPU: 1 PID: 6716 Comm: kworker/u8:2 Not tainted 4.9.0-rc6-CI-Nightly_816+ #1
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698871] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699125] Workqueue: events_unbound intel_mmio_flip_work_func [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699266] task: ffff880260a5e800 task.stack: ffffc90000f6c000
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699361] RIP: 0010:[<ffffffffa006595d>]  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699632] RSP: 0018:ffffc90000f6fcd8  EFLAGS: 00010206
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699724] RAX: dead0000000000f8 RBX: ffff8801f64b2bf0 RCX: ffff8801f64b2c10
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699842] RDX: dead000000000100 RSI: 0000000000000000 RDI: ffff8801f64b0458
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699972] RBP: ffffc90000f6fd68 R08: ffff88026488dc00 R09: 0000000000000002
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700090] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000400
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700195] R13: ffffc90000f6fcf0 R14: ffff88020955aa40 R15: ffff88020955aa68
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700307] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700435] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700532] CR2: 0000000002a69e90 CR3: 0000000002c07000 CR4: 00000000003406e0
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700635] Stack:
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700682]  ffff880260a5e880 ffffc90000f6fd50 ffffffff810af69a ffffc90000f6fd28
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700827]  ffff88020955a628 ffff8801e1eaebf0 0000000000000020 0000000000000000
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700947]  00000196af1edc96 ffff88025dfa4000 ffff8801f0b030a8 ffffc90000f6fcf0
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701071] Call Trace:
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701117]  [<ffffffff810af69a>] ? dequeue_entity+0x25a/0xb50
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701260]  [<ffffffffa00516be>] fence_set_priority+0x7e/0x80 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701406]  [<ffffffffa0051a15>] i915_gem_object_wait_priority+0x85/0x160 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701599]  [<ffffffffa008ccd7>] intel_mmio_flip_work_func+0x47/0x2b0 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701717]  [<ffffffff81094c4d>] process_one_work+0x14d/0x470
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701809]  [<ffffffff81094fb3>] worker_thread+0x43/0x4e0
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701888]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701969]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702072]  [<ffffffff8109a4d5>] kthread+0xc5/0xe0
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702152]  [<ffffffff81771c59>] ? _raw_spin_unlock_irq+0x9/0x10
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702234]  [<ffffffff8109a410>] ? kthread_park+0x60/0x60
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702318]  [<ffffffff81772272>] ret_from_fork+0x22/0x30
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702387] Code: 89 42 08 48 8b 45 88 48 89 55 c0 4c 89 6d c8 4c 8d 70 d8 4d 8d 7e 28 4d 39 ef 74 72 49 8b 1e 48 8b 13 48 39 d3 48 8d 42 f8 74 3e <48> 8b 10 8b 52 38 41 39 d4 7e 26 48 8b 50 30 48 8b 78 28 48 8d
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702921] RIP  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.703027]  RSP <ffffc90000f6fcd8>
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711015] ---[ end trace 4ecf3ae63087e670 ]---
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711023] BUG: unable to handle kernel NULL pointer dereference at 000000000000000b
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711070] IP: [<ffffffff810baf76>] __wake_up_common+0x26/0x80
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711104] PGD 25df92067
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711119] PUD 25b1f0067
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711134] PMD 0
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711140]
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711151] Oops: 0000 [#2] PREEMPT SMP
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711172] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711298] CPU: 1 PID: 6716 Comm: kworker/u8:2 Tainted: G      D         4.9.0-rc6-CI-Nightly_816+ #1
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711342] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711386] task: ffff880260a5e800 task.stack: ffffc90000f6c000
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711415] RIP: 0010:[<ffffffff810baf76>]  [<ffffffff810baf76>] __wake_up_common+0x26/0x80
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711449] RSP: 0018:ffffc90000f6fe50  EFLAGS: 00010092
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711464] RAX: 0000000000000282 RBX: ffffc90000f6ff18 RCX: 0000000000000000
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711484] RDX: 000000000000000b RSI: 0000000000000003 RDI: ffffc90000f6ff18
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711503] RBP: ffffc90000f6fe88 R08: 0000000000000000 R09: 0000000000000005
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711522] R10: 00000000ffffffff R11: 00000000000002cb R12: ffffc90000f6ff20
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711541] R13: 0000000000000282 R14: 0000000000000000 R15: 0000000000000003
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711561] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711583] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711599] CR2: 0000000000000028 CR3: 0000000263b53000 CR4: 00000000003406e0
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711617] Stack:
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711624]  0000000100f6fe60 0000000000000000 ffffc90000f6ff18 ffffc90000f6ff10
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711650]  0000000000000282 0000000000000000 ffff88020955aa68 ffffc90000f6fe98
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711674]  ffffffff810bb02e ffffc90000f6fec0 ffffffff810bb8d2 ffff880260a5ee40
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711701] Call Trace:
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711710]  [<ffffffff810bb02e>] __wake_up_locked+0xe/0x10
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711726]  [<ffffffff810bb8d2>] complete+0x32/0x50
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711757]  [<ffffffff8107a1a8>] mm_release+0xb8/0x140
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711773]  [<ffffffff81080e6b>] do_exit+0x28b/0xae0
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711789]  [<ffffffff81773f17>] rewind_stack_do_exit+0x17/0x20
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711806] Code: 5d c3 0f 1f 00 55 48 89 e5 41 57 41 56 41 55 41 54 4c 8d 67 08 53 41 89 f7 48 83 ec 10 89 55 cc 48 8b 57 08 4c 89 45 d0 49 39 d4 <48> 8b 32 74 45 41 89 ce 48 8d 42 e8 4c 8d 6e e8 eb 03 49 89 d5
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711937] RIP  [<ffffffff810baf76>] __wake_up_common+0x26/0x80
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.713142]  RSP <ffffc90000f6fe50>
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.714340] CR2: 000000000000000b
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.715439] ---[ end trace 4ecf3ae63087e671 ]---
Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.715441] Fixing recursive fault but reboot is needed!

Fixes: 27745e829a5c ("drm/i915/execlists: Use a local lock for dfs_link access")
Fixes: 9a151987d709 ("drm/i915: Add execution priority boosting for mmioflips")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Weinehall <david.weinehall@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 77c4ff9efbe3..7a4f7730877a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12022,7 +12022,6 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
 		to_intel_framebuffer(crtc->base.primary->fb);
 	struct drm_i915_gem_object *obj = intel_fb->obj;
 
-	i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY);
 	WARN_ON(i915_gem_object_wait(obj, 0, MAX_SCHEDULE_TIMEOUT, NULL) < 0);
 
 	intel_pipe_update_start(crtc);
@@ -12278,6 +12277,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 		i915_add_request_no_flush(request);
 	}
 
+	i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY);
 	i915_gem_track_fb(intel_fb_obj(old_fb), obj,
 			  to_intel_plane(primary)->frontbuffer_bit);
 	mutex_unlock(&dev->struct_mutex);
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access"
  2016-11-28 14:36 [PATCH 1/2] drm/i915: Move priority bumping for flips earlier Chris Wilson
@ 2016-11-28 14:36 ` Chris Wilson
  2016-11-29  8:51   ` Tvrtko Ursulin
  2016-11-28 15:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Move priority bumping for flips earlier Patchwork
  2016-11-29  8:50 ` [PATCH 1/2] " Tvrtko Ursulin
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2016-11-28 14:36 UTC (permalink / raw)
  To: intel-gfx

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 <chris@chris-wilson.co.uk>
Cc: David Weinehall <david.weinehall@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 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(&lock);
+	/* Need BKL in order to use the temporary link inside i915_dependency */
+	lockdep_assert_held(&request->i915->drm.struct_mutex);
 
 	stack.signaler = &request->priotree;
 	list_add(&stack.dfs_link, &dfs);
@@ -772,8 +771,6 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
 	if (engine)
 		spin_unlock_irq(&engine->timeline->lock);
 
-	mutex_unlock(&lock);
-
 	/* XXX Do we need to preempt to make room for us and our deps? */
 }
 
-- 
2.10.2

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Move priority bumping for flips earlier
  2016-11-28 14:36 [PATCH 1/2] drm/i915: Move priority bumping for flips earlier Chris Wilson
  2016-11-28 14:36 ` [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access" Chris Wilson
@ 2016-11-28 15:15 ` Patchwork
  2016-11-29  8:50 ` [PATCH 1/2] " Tvrtko Ursulin
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-11-28 15:15 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: Move priority bumping for flips earlier
URL   : https://patchwork.freedesktop.org/series/16043/
State : success

== Summary ==

Series 16043v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16043/revisions/1/mbox/


fi-bdw-5557u     total:245  pass:230  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:245  pass:205  dwarn:0   dfail:0   fail:0   skip:40 
fi-byt-j1900     total:245  pass:217  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:245  pass:213  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:245  pass:225  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:245  pass:225  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:245  pass:192  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:245  pass:223  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:245  pass:223  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7500u     total:245  pass:223  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:245  pass:231  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:245  pass:224  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:245  pass:223  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:245  pass:231  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:245  pass:213  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:245  pass:212  dwarn:0   dfail:0   fail:0   skip:33 

8f02d2103390e48e9e76c9e75d16dbb4396484c8 drm-tip: 2016y-11m-28d-12h-38m-14s UTC integration manifest
f25e8a3 Revert "drm/i915/execlists: Use a local lock for dfs_link access"
12aacba9 drm/i915: Move priority bumping for flips earlier

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3126/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/i915: Move priority bumping for flips earlier
  2016-11-28 14:36 [PATCH 1/2] drm/i915: Move priority bumping for flips earlier Chris Wilson
  2016-11-28 14:36 ` [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access" Chris Wilson
  2016-11-28 15:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Move priority bumping for flips earlier Patchwork
@ 2016-11-29  8:50 ` Tvrtko Ursulin
  2 siblings, 0 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2016-11-29  8:50 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 28/11/2016 14:36, Chris Wilson wrote:
> David found another issue with priority bumping from mmioflips, where we
> are accessing the requests concurrently to them being retired and freed.
> Whilst we are skipping the dependency if has been submitted, that is not
> sufficient to stop the dependency from disappearing if another thread
> retires that request. To prevent we can either employ the struct_mutex (or a
> request mutex in the future) to serialise retiring before it is freed.
> Alternatively, we need to keep the dependencies alive using RCU whilst
> they are being accessed via the DFS.
>
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698111] general protection fault: 0000 [#1] PREEMPT SMP
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698305] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698750] CPU: 1 PID: 6716 Comm: kworker/u8:2 Not tainted 4.9.0-rc6-CI-Nightly_816+ #1
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.698871] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699125] Workqueue: events_unbound intel_mmio_flip_work_func [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699266] task: ffff880260a5e800 task.stack: ffffc90000f6c000
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699361] RIP: 0010:[<ffffffffa006595d>]  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699632] RSP: 0018:ffffc90000f6fcd8  EFLAGS: 00010206
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699724] RAX: dead0000000000f8 RBX: ffff8801f64b2bf0 RCX: ffff8801f64b2c10
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699842] RDX: dead000000000100 RSI: 0000000000000000 RDI: ffff8801f64b0458
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.699972] RBP: ffffc90000f6fd68 R08: ffff88026488dc00 R09: 0000000000000002
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700090] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000400
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700195] R13: ffffc90000f6fcf0 R14: ffff88020955aa40 R15: ffff88020955aa68
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700307] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700435] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700532] CR2: 0000000002a69e90 CR3: 0000000002c07000 CR4: 00000000003406e0
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700635] Stack:
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700682]  ffff880260a5e880 ffffc90000f6fd50 ffffffff810af69a ffffc90000f6fd28
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700827]  ffff88020955a628 ffff8801e1eaebf0 0000000000000020 0000000000000000
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.700947]  00000196af1edc96 ffff88025dfa4000 ffff8801f0b030a8 ffffc90000f6fcf0
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701071] Call Trace:
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701117]  [<ffffffff810af69a>] ? dequeue_entity+0x25a/0xb50
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701260]  [<ffffffffa00516be>] fence_set_priority+0x7e/0x80 [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701406]  [<ffffffffa0051a15>] i915_gem_object_wait_priority+0x85/0x160 [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701599]  [<ffffffffa008ccd7>] intel_mmio_flip_work_func+0x47/0x2b0 [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701717]  [<ffffffff81094c4d>] process_one_work+0x14d/0x470
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701809]  [<ffffffff81094fb3>] worker_thread+0x43/0x4e0
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701888]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.701969]  [<ffffffff81094f70>] ? process_one_work+0x470/0x470
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702072]  [<ffffffff8109a4d5>] kthread+0xc5/0xe0
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702152]  [<ffffffff81771c59>] ? _raw_spin_unlock_irq+0x9/0x10
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702234]  [<ffffffff8109a410>] ? kthread_park+0x60/0x60
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702318]  [<ffffffff81772272>] ret_from_fork+0x22/0x30
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702387] Code: 89 42 08 48 8b 45 88 48 89 55 c0 4c 89 6d c8 4c 8d 70 d8 4d 8d 7e 28 4d 39 ef 74 72 49 8b 1e 48 8b 13 48 39 d3 48 8d 42 f8 74 3e <48> 8b 10 8b 52 38 41 39 d4 7e 26 48 8b 50 30 48 8b 78 28 48 8d
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.702921] RIP  [<ffffffffa006595d>] execlists_schedule+0x8d/0x300 [i915]
> Nov 25 21:42:54 kbl-gbbki7 kernel: [ 1746.703027]  RSP <ffffc90000f6fcd8>
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711015] ---[ end trace 4ecf3ae63087e670 ]---
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711023] BUG: unable to handle kernel NULL pointer dereference at 000000000000000b
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711070] IP: [<ffffffff810baf76>] __wake_up_common+0x26/0x80
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711104] PGD 25df92067
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711119] PUD 25b1f0067
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711134] PMD 0
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711140]
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711151] Oops: 0000 [#2] PREEMPT SMP
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711172] Modules linked in: snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core coretemp crct10dif_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei i915 e1000e ptp pps_core i2c_hid
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711298] CPU: 1 PID: 6716 Comm: kworker/u8:2 Tainted: G      D         4.9.0-rc6-CI-Nightly_816+ #1
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711342] Hardware name: GIGABYTE GB-BKi7A-7500/MFLP7AP-00, BIOS F1 07/27/2016
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711386] task: ffff880260a5e800 task.stack: ffffc90000f6c000
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711415] RIP: 0010:[<ffffffff810baf76>]  [<ffffffff810baf76>] __wake_up_common+0x26/0x80
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711449] RSP: 0018:ffffc90000f6fe50  EFLAGS: 00010092
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711464] RAX: 0000000000000282 RBX: ffffc90000f6ff18 RCX: 0000000000000000
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711484] RDX: 000000000000000b RSI: 0000000000000003 RDI: ffffc90000f6ff18
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711503] RBP: ffffc90000f6fe88 R08: 0000000000000000 R09: 0000000000000005
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711522] R10: 00000000ffffffff R11: 00000000000002cb R12: ffffc90000f6ff20
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711541] R13: 0000000000000282 R14: 0000000000000000 R15: 0000000000000003
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711561] FS:  0000000000000000(0000) GS:ffff88026dc80000(0000) knlGS:0000000000000000
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711583] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711599] CR2: 0000000000000028 CR3: 0000000263b53000 CR4: 00000000003406e0
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711617] Stack:
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711624]  0000000100f6fe60 0000000000000000 ffffc90000f6ff18 ffffc90000f6ff10
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711650]  0000000000000282 0000000000000000 ffff88020955aa68 ffffc90000f6fe98
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711674]  ffffffff810bb02e ffffc90000f6fec0 ffffffff810bb8d2 ffff880260a5ee40
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711701] Call Trace:
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711710]  [<ffffffff810bb02e>] __wake_up_locked+0xe/0x10
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711726]  [<ffffffff810bb8d2>] complete+0x32/0x50
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711757]  [<ffffffff8107a1a8>] mm_release+0xb8/0x140
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711773]  [<ffffffff81080e6b>] do_exit+0x28b/0xae0
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711789]  [<ffffffff81773f17>] rewind_stack_do_exit+0x17/0x20
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711806] Code: 5d c3 0f 1f 00 55 48 89 e5 41 57 41 56 41 55 41 54 4c 8d 67 08 53 41 89 f7 48 83 ec 10 89 55 cc 48 8b 57 08 4c 89 45 d0 49 39 d4 <48> 8b 32 74 45 41 89 ce 48 8d 42 e8 4c 8d 6e e8 eb 03 49 89 d5
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.711937] RIP  [<ffffffff810baf76>] __wake_up_common+0x26/0x80
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.713142]  RSP <ffffc90000f6fe50>
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.714340] CR2: 000000000000000b
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.715439] ---[ end trace 4ecf3ae63087e671 ]---
> Nov 25 21:44:11 kbl-gbbki7 kernel: [ 1746.715441] Fixing recursive fault but reboot is needed!
>
> Fixes: 27745e829a5c ("drm/i915/execlists: Use a local lock for dfs_link access")
> Fixes: 9a151987d709 ("drm/i915: Add execution priority boosting for mmioflips")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 77c4ff9efbe3..7a4f7730877a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12022,7 +12022,6 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
>  		to_intel_framebuffer(crtc->base.primary->fb);
>  	struct drm_i915_gem_object *obj = intel_fb->obj;
>
> -	i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY);
>  	WARN_ON(i915_gem_object_wait(obj, 0, MAX_SCHEDULE_TIMEOUT, NULL) < 0);
>
>  	intel_pipe_update_start(crtc);
> @@ -12278,6 +12277,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
>  		i915_add_request_no_flush(request);
>  	}
>
> +	i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY);
>  	i915_gem_track_fb(intel_fb_obj(old_fb), obj,
>  			  to_intel_plane(primary)->frontbuffer_bit);
>  	mutex_unlock(&dev->struct_mutex);
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access"
  2016-11-28 14:36 ` [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access" Chris Wilson
@ 2016-11-29  8:51   ` Tvrtko Ursulin
  2016-11-29  9:22     ` Chris Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Tvrtko Ursulin @ 2016-11-29  8:51 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


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 <chris@chris-wilson.co.uk>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  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(&lock);
> +	/* Need BKL in order to use the temporary link inside i915_dependency */
> +	lockdep_assert_held(&request->i915->drm.struct_mutex);
>
>  	stack.signaler = &request->priotree;
>  	list_add(&stack.dfs_link, &dfs);
> @@ -772,8 +771,6 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
>  	if (engine)
>  		spin_unlock_irq(&engine->timeline->lock);
>
> -	mutex_unlock(&lock);
> -
>  	/* XXX Do we need to preempt to make room for us and our deps? */
>  }
>
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access"
  2016-11-29  8:51   ` Tvrtko Ursulin
@ 2016-11-29  9:22     ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2016-11-29  9:22 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

On Tue, Nov 29, 2016 at 08:51:02AM +0000, 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 <chris@chris-wilson.co.uk>
> >Cc: David Weinehall <david.weinehall@linux.intel.com>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-29  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 14:36 [PATCH 1/2] drm/i915: Move priority bumping for flips earlier Chris Wilson
2016-11-28 14:36 ` [PATCH 2/2] Revert "drm/i915/execlists: Use a local lock for dfs_link access" Chris Wilson
2016-11-29  8:51   ` Tvrtko Ursulin
2016-11-29  9:22     ` Chris Wilson
2016-11-28 15:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Move priority bumping for flips earlier Patchwork
2016-11-29  8:50 ` [PATCH 1/2] " Tvrtko Ursulin

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.