Chris Wilson
614654abe8
drm/i915: Check current i915_vma.pin_count status first on unbind
...
Do an early rejection of a i915_vma_unbind() attempt if the i915_vma is
currently pinned, without waiting to see if the inflight operations may
unpin it. We see this problem with the shrinker trying to unbind the
active vma from inside its bind worker:
<6> [472.618968] Workqueue: events_unbound fence_work [i915]
<4> [472.618970] Call Trace:
<4> [472.618974] ? __schedule+0x2e5/0x810
<4> [472.618978] schedule+0x37/0xe0
<4> [472.618982] schedule_preempt_disabled+0xf/0x20
<4> [472.618984] __mutex_lock+0x281/0x9c0
<4> [472.618987] ? mark_held_locks+0x49/0x70
<4> [472.618989] ? _raw_spin_unlock_irqrestore+0x47/0x60
<4> [472.619038] ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619084] ? i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619122] i915_vma_unbind+0xae/0x110 [i915]
<4> [472.619165] i915_gem_object_unbind+0x1dc/0x400 [i915]
<4> [472.619208] i915_gem_shrink+0x328/0x660 [i915]
<4> [472.619250] ? i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619282] i915_gem_shrink_all+0x38/0x60 [i915]
<4> [472.619325] vm_alloc_page.constprop.25+0x1aa/0x240 [i915]
<4> [472.619330] ? rcu_read_lock_sched_held+0x4d/0x80
<4> [472.619363] ? __alloc_pd+0xb/0x30 [i915]
<4> [472.619366] ? module_assert_mutex_or_preempt+0xf/0x30
<4> [472.619368] ? __module_address+0x23/0xe0
<4> [472.619371] ? is_module_address+0x26/0x40
<4> [472.619374] ? static_obj+0x34/0x50
<4> [472.619376] ? lockdep_init_map+0x4d/0x1e0
<4> [472.619407] setup_page_dma+0xd/0x90 [i915]
<4> [472.619437] alloc_pd+0x29/0x50 [i915]
<4> [472.619470] __gen8_ppgtt_alloc+0x443/0x6b0 [i915]
<4> [472.619503] gen8_ppgtt_alloc+0xd7/0x300 [i915]
<4> [472.619535] ppgtt_bind_vma+0x2a/0xe0 [i915]
<4> [472.619577] __vma_bind+0x26/0x40 [i915]
<4> [472.619611] fence_work+0x1c/0x90 [i915]
<4> [472.619617] process_one_work+0x26a/0x620
Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200403120150.17091-1-chris@chris-wilson.co.uk
2020-04-03 19:39:57 +01:00
..
2020-02-11 23:26:15 +01:00
2020-01-29 18:53:37 -08:00
2020-02-06 06:11:50 +00:00
2020-01-28 16:02:33 -08:00
2020-02-08 14:04:19 -08:00
2020-01-28 16:02:33 -08:00
2020-02-08 13:26:41 -08:00
2020-01-24 19:57:53 +01:00
2020-02-15 10:33:19 -08:00
2020-02-16 13:05:46 -08:00
2020-02-08 14:17:27 -08:00
2020-02-08 14:17:27 -08:00
2020-02-14 10:40:48 +01:00
2020-02-08 14:04:19 -08:00
2020-01-28 16:02:33 -08:00
2020-01-16 09:52:27 -08:00
2020-01-16 19:14:49 +09:00
2020-02-08 13:58:44 -08:00
2020-02-13 13:29:41 +01:00
2020-02-08 14:04:19 -08:00
2020-01-10 12:51:56 -08:00
2020-02-10 13:54:17 +01:00
2020-04-03 19:39:57 +01:00
2020-01-30 08:04:01 -08:00
2020-02-03 14:42:03 +00:00
2020-02-12 12:43:01 -08:00
2020-01-21 16:16:36 -08:00
2020-01-14 15:38:28 +01:00
2020-02-07 12:54:13 -08:00
2020-01-13 10:00:05 +01:00
2020-02-04 03:05:26 +00:00
2020-02-03 11:57:18 +01:00
2020-02-04 07:17:41 +00:00
2020-02-14 15:21:52 -04:00
2020-02-15 16:49:25 -08:00
2020-02-05 17:49:54 +00:00
2020-02-09 15:47:37 -08:00
2020-02-04 03:05:26 +00:00
2020-01-22 21:08:24 +01:00
2020-02-04 13:06:46 +00:00
2020-01-08 10:41:52 +01:00
2020-02-16 12:35:52 -08:00
2020-02-04 07:17:41 +00:00
2020-01-16 10:45:44 -08:00
2020-01-19 22:10:04 +01:00
2020-02-04 07:17:41 +00:00
2020-02-07 12:54:13 -08:00
2020-01-27 13:03:00 -08:00
2020-02-04 03:05:27 +00:00
2020-02-14 07:05:17 -08:00
2020-01-19 22:10:04 +01:00
2020-01-31 10:30:37 -08:00
2020-02-16 12:35:52 -08:00
2020-02-07 12:54:13 -08:00
2020-02-08 14:04:19 -08:00
2020-01-27 13:03:00 -08:00
2020-01-13 13:19:38 -05:00
2020-02-04 03:05:26 +00:00
2020-02-06 14:17:38 +00:00
2020-02-10 18:14:46 +00:00
2020-02-04 03:05:27 +00:00
2020-02-04 03:05:24 +00:00
2020-02-04 07:24:48 +00:00
2020-02-04 03:05:26 +00:00
2020-02-08 13:55:25 -08:00
2020-01-13 10:32:19 +01:00
2020-01-19 22:10:04 +01:00
2020-01-20 15:40:49 +01:00
2020-02-03 14:51:57 +00:00
2020-01-24 09:34:07 -08:00
2020-01-10 22:20:37 -08:00
2020-01-20 10:29:56 -08:00
2020-02-04 07:17:41 +00:00
2020-02-11 20:14:28 +01:00
2020-02-08 17:24:41 -08:00
2020-01-14 21:46:53 +01:00
2020-01-14 21:46:48 +01:00
2020-02-11 15:00:15 -08:00
2020-01-16 17:34:38 +05:30
2020-02-04 03:05:27 +00:00
2020-02-10 13:16:04 +01:00
2020-02-04 03:05:26 +00:00
2020-01-29 18:16:16 -08:00
2020-01-31 11:28:31 -08:00
2020-02-08 14:04:19 -08:00
2020-01-31 14:39:21 -08:00
2020-01-14 15:37:41 +01:00
2020-02-09 16:05:50 -08:00
2020-01-14 15:27:51 +01:00
2020-02-08 13:26:41 -08:00
2020-02-03 22:22:05 +00:00
2020-02-21 05:44:40 +10:00
2020-02-06 03:40:27 -05:00
2020-01-14 15:30:35 +01:00
2020-01-29 10:35:54 -08:00
2020-01-29 10:35:54 -08:00
2020-02-07 12:30:16 -08:00
2020-02-05 17:44:14 +00:00
2020-02-09 16:05:50 -08:00