* [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
@ 2016-08-22 11:35 Chris Wilson
2016-08-22 11:44 ` Joonas Lahtinen
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chris Wilson @ 2016-08-22 11:35 UTC (permalink / raw)
To: intel-gfx
[ 284.922349] ======================================================
[ 284.922355] [ INFO: possible circular locking dependency detected ]
[ 284.922361] 4.8.0-rc2+ #430 Tainted: G W
[ 284.922366] -------------------------------------------------------
[ 284.922371] cat/1197 is trying to acquire lock:
[ 284.922376] (&dev->filelist_mutex){+.+...}, at: [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
[ 284.922423]
[ 284.922423] but task is already holding lock:
[ 284.922429] (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
[ 284.922465]
[ 284.922465] which lock already depends on the new lock.
[ 284.922465]
[ 284.922471]
[ 284.922471] the existing dependency chain (in reverse order) is:
[ 284.922477]
-> #1 (&dev->struct_mutex){+.+.+.}:
[ 284.922493] [<ffffffff81087710>] lock_acquire+0x60/0x80
[ 284.922505] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
[ 284.922520] [<ffffffffa004f877>] print_context_stats+0x37/0xf0 [i915]
[ 284.922549] [<ffffffffa00535f5>] i915_gem_object_info+0x265/0x490 [i915]
[ 284.922581] [<ffffffff81144491>] seq_read+0xe1/0x3b0
[ 284.922592] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
[ 284.922604] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
[ 284.922616] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
[ 284.922626] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
[ 284.922636] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
[ 284.922648]
-> #0 (&dev->filelist_mutex){+.+...}:
[ 284.922667] [<ffffffff810871fc>] __lock_acquire+0x10fc/0x1270
[ 284.922678] [<ffffffff81087710>] lock_acquire+0x60/0x80
[ 284.922689] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
[ 284.922701] [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
[ 284.922729] [<ffffffff81144491>] seq_read+0xe1/0x3b0
[ 284.922739] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
[ 284.922750] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
[ 284.922761] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
[ 284.922771] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
[ 284.922781] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
[ 284.922793]
[ 284.922793] other info that might help us debug this:
[ 284.922793]
[ 284.922809] Possible unsafe locking scenario:
[ 284.922809]
[ 284.922818] CPU0 CPU1
[ 284.922825] ---- ----
[ 284.922831] lock(&dev->struct_mutex);
[ 284.922842] lock(&dev->filelist_mutex);
[ 284.922854] lock(&dev->struct_mutex);
[ 284.922865] lock(&dev->filelist_mutex);
[ 284.922875]
[ 284.922875] *** DEADLOCK ***
[ 284.922875]
[ 284.922888] 3 locks held by cat/1197:
[ 284.922895] #0: (debugfs_srcu){......}, at: [<ffffffff811f7730>] full_proxy_read+0x0/0xb0
[ 284.922919] #1: (&p->lock){+.+.+.}, at: [<ffffffff811443e8>] seq_read+0x38/0x3b0
[ 284.922942] #2: (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
[ 284.922983]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 5193b0447066..c5ef132f8b51 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2291,10 +2291,13 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
struct drm_device *dev = node->minor->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_file *file;
+ int ret;
- int ret = mutex_lock_interruptible(&dev->struct_mutex);
+ mutex_lock(&dev->filelist_mutex);
+ ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
- return ret;
+ goto out_unlock;
+
intel_runtime_pm_get(dev_priv);
if (INTEL_INFO(dev)->gen >= 8)
@@ -2302,7 +2305,6 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
else if (INTEL_INFO(dev)->gen >= 6)
gen6_ppgtt_info(m, dev);
- mutex_lock(&dev->filelist_mutex);
list_for_each_entry_reverse(file, &dev->filelist, lhead) {
struct drm_i915_file_private *file_priv = file->driver_priv;
struct task_struct *task;
@@ -2310,19 +2312,19 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
task = get_pid_task(file->pid, PIDTYPE_PID);
if (!task) {
ret = -ESRCH;
- goto out_unlock;
+ goto out_rpm;
}
seq_printf(m, "\nproc: %s\n", task->comm);
put_task_struct(task);
idr_for_each(&file_priv->context_idr, per_file_ctx,
(void *)(unsigned long)m);
}
-out_unlock:
- mutex_unlock(&dev->filelist_mutex);
+out_rpm:
intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev->struct_mutex);
-
+out_unlock:
+ mutex_unlock(&dev->filelist_mutex);
return ret;
}
--
2.9.3
_______________________________________________
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
* Re: [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
2016-08-22 11:35 [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info Chris Wilson
@ 2016-08-22 11:44 ` Joonas Lahtinen
2016-08-22 12:09 ` Jani Nikula
2016-08-22 12:11 ` ✗ Ro.CI.BAT: warning for " Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Joonas Lahtinen @ 2016-08-22 11:44 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
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] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
2016-08-22 11:35 [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info Chris Wilson
2016-08-22 11:44 ` Joonas Lahtinen
@ 2016-08-22 12:09 ` Jani Nikula
2016-08-22 12:15 ` Chris Wilson
2016-08-22 12:11 ` ✗ Ro.CI.BAT: warning for " Patchwork
2 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2016-08-22 12:09 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On Mon, 22 Aug 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> [ 284.922349] ======================================================
> [ 284.922355] [ INFO: possible circular locking dependency detected ]
> [ 284.922361] 4.8.0-rc2+ #430 Tainted: G W
> [ 284.922366] -------------------------------------------------------
> [ 284.922371] cat/1197 is trying to acquire lock:
> [ 284.922376] (&dev->filelist_mutex){+.+...}, at: [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
> [ 284.922423]
> [ 284.922423] but task is already holding lock:
> [ 284.922429] (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
> [ 284.922465]
> [ 284.922465] which lock already depends on the new lock.
> [ 284.922465]
> [ 284.922471]
> [ 284.922471] the existing dependency chain (in reverse order) is:
> [ 284.922477]
> -> #1 (&dev->struct_mutex){+.+.+.}:
> [ 284.922493] [<ffffffff81087710>] lock_acquire+0x60/0x80
> [ 284.922505] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
> [ 284.922520] [<ffffffffa004f877>] print_context_stats+0x37/0xf0 [i915]
> [ 284.922549] [<ffffffffa00535f5>] i915_gem_object_info+0x265/0x490 [i915]
> [ 284.922581] [<ffffffff81144491>] seq_read+0xe1/0x3b0
> [ 284.922592] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
> [ 284.922604] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
> [ 284.922616] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
> [ 284.922626] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
> [ 284.922636] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
> [ 284.922648]
> -> #0 (&dev->filelist_mutex){+.+...}:
> [ 284.922667] [<ffffffff810871fc>] __lock_acquire+0x10fc/0x1270
> [ 284.922678] [<ffffffff81087710>] lock_acquire+0x60/0x80
> [ 284.922689] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
> [ 284.922701] [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
> [ 284.922729] [<ffffffff81144491>] seq_read+0xe1/0x3b0
> [ 284.922739] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
> [ 284.922750] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
> [ 284.922761] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
> [ 284.922771] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
> [ 284.922781] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
> [ 284.922793]
> [ 284.922793] other info that might help us debug this:
> [ 284.922793]
> [ 284.922809] Possible unsafe locking scenario:
> [ 284.922809]
> [ 284.922818] CPU0 CPU1
> [ 284.922825] ---- ----
> [ 284.922831] lock(&dev->struct_mutex);
> [ 284.922842] lock(&dev->filelist_mutex);
> [ 284.922854] lock(&dev->struct_mutex);
> [ 284.922865] lock(&dev->filelist_mutex);
> [ 284.922875]
> [ 284.922875] *** DEADLOCK ***
> [ 284.922875]
> [ 284.922888] 3 locks held by cat/1197:
> [ 284.922895] #0: (debugfs_srcu){......}, at: [<ffffffff811f7730>] full_proxy_read+0x0/0xb0
> [ 284.922919] #1: (&p->lock){+.+.+.}, at: [<ffffffff811443e8>] seq_read+0x38/0x3b0
> [ 284.922942] #2: (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
> [ 284.922983]
Do we have a regressing commit reference?
BR,
Jani.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 5193b0447066..c5ef132f8b51 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2291,10 +2291,13 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
> struct drm_device *dev = node->minor->dev;
> struct drm_i915_private *dev_priv = to_i915(dev);
> struct drm_file *file;
> + int ret;
>
> - int ret = mutex_lock_interruptible(&dev->struct_mutex);
> + mutex_lock(&dev->filelist_mutex);
> + ret = mutex_lock_interruptible(&dev->struct_mutex);
> if (ret)
> - return ret;
> + goto out_unlock;
> +
> intel_runtime_pm_get(dev_priv);
>
> if (INTEL_INFO(dev)->gen >= 8)
> @@ -2302,7 +2305,6 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
> else if (INTEL_INFO(dev)->gen >= 6)
> gen6_ppgtt_info(m, dev);
>
> - mutex_lock(&dev->filelist_mutex);
> list_for_each_entry_reverse(file, &dev->filelist, lhead) {
> struct drm_i915_file_private *file_priv = file->driver_priv;
> struct task_struct *task;
> @@ -2310,19 +2312,19 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
> task = get_pid_task(file->pid, PIDTYPE_PID);
> if (!task) {
> ret = -ESRCH;
> - goto out_unlock;
> + goto out_rpm;
> }
> seq_printf(m, "\nproc: %s\n", task->comm);
> put_task_struct(task);
> idr_for_each(&file_priv->context_idr, per_file_ctx,
> (void *)(unsigned long)m);
> }
> -out_unlock:
> - mutex_unlock(&dev->filelist_mutex);
>
> +out_rpm:
> intel_runtime_pm_put(dev_priv);
> mutex_unlock(&dev->struct_mutex);
> -
> +out_unlock:
> + mutex_unlock(&dev->filelist_mutex);
> return ret;
> }
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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
* ✗ Ro.CI.BAT: warning for drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
2016-08-22 11:35 [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info Chris Wilson
2016-08-22 11:44 ` Joonas Lahtinen
2016-08-22 12:09 ` Jani Nikula
@ 2016-08-22 12:11 ` Patchwork
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-08-22 12:11 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
URL : https://patchwork.freedesktop.org/series/11411/
State : warning
== Summary ==
Series 11411v1 drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
http://patchwork.freedesktop.org/api/1.0/series/11411/revisions/1/mbox
Test gem_exec_suspend:
Subgroup basic-s3:
dmesg-warn -> PASS (ro-bdw-i7-5557U)
Test kms_flip:
Subgroup basic-plain-flip:
dmesg-warn -> PASS (ro-bdw-i7-5557U)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> SKIP (ro-bdw-i7-5557U)
skip -> DMESG-WARN (ro-bdw-i5-5250u)
Subgroup suspend-read-crc-pipe-c:
skip -> DMESG-WARN (ro-bdw-i5-5250u)
fi-hsw-i7-4770k total:107 pass:91 dwarn:0 dfail:0 fail:0 skip:15
fi-kbl-qkkr total:244 pass:186 dwarn:29 dfail:0 fail:2 skip:27
fi-skl-i7-6700k total:244 pass:210 dwarn:4 dfail:2 fail:0 skip:28
fi-snb-i7-2600 total:244 pass:198 dwarn:4 dfail:0 fail:0 skip:42
ro-bdw-i5-5250u total:240 pass:219 dwarn:5 dfail:0 fail:0 skip:16
ro-bdw-i7-5557U total:240 pass:220 dwarn:1 dfail:0 fail:0 skip:19
ro-bdw-i7-5600u total:240 pass:206 dwarn:0 dfail:0 fail:2 skip:32
ro-bsw-n3050 total:240 pass:194 dwarn:0 dfail:0 fail:4 skip:42
ro-byt-n2820 total:240 pass:196 dwarn:0 dfail:0 fail:4 skip:40
ro-hsw-i3-4010u total:240 pass:213 dwarn:0 dfail:0 fail:1 skip:26
ro-hsw-i7-4770r total:240 pass:185 dwarn:0 dfail:0 fail:0 skip:55
ro-ilk1-i5-650 total:235 pass:174 dwarn:0 dfail:0 fail:2 skip:59
ro-ivb-i7-3770 total:240 pass:204 dwarn:0 dfail:0 fail:1 skip:35
ro-ivb2-i7-3770 total:240 pass:208 dwarn:0 dfail:0 fail:1 skip:31
ro-skl3-i5-6260u total:240 pass:225 dwarn:0 dfail:0 fail:1 skip:14
Results at /archive/results/CI_IGT_test/RO_Patchwork_1963/
020f7af drm-intel-nightly: 2016y-08m-22d-11h-29m-35s UTC integration manifest
8ab3127 drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
_______________________________________________
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] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
2016-08-22 12:09 ` Jani Nikula
@ 2016-08-22 12:15 ` Chris Wilson
2016-08-22 12:28 ` Jani Nikula
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2016-08-22 12:15 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Mon, Aug 22, 2016 at 03:09:48PM +0300, Jani Nikula wrote:
>
> On Mon, 22 Aug 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > [ 284.922349] ======================================================
> > [ 284.922355] [ INFO: possible circular locking dependency detected ]
> > [ 284.922361] 4.8.0-rc2+ #430 Tainted: G W
> > [ 284.922366] -------------------------------------------------------
> > [ 284.922371] cat/1197 is trying to acquire lock:
> > [ 284.922376] (&dev->filelist_mutex){+.+...}, at: [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
> > [ 284.922423]
> > [ 284.922423] but task is already holding lock:
> > [ 284.922429] (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
> > [ 284.922465]
> > [ 284.922465] which lock already depends on the new lock.
> > [ 284.922465]
> > [ 284.922471]
> > [ 284.922471] the existing dependency chain (in reverse order) is:
> > [ 284.922477]
> > -> #1 (&dev->struct_mutex){+.+.+.}:
> > [ 284.922493] [<ffffffff81087710>] lock_acquire+0x60/0x80
> > [ 284.922505] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
> > [ 284.922520] [<ffffffffa004f877>] print_context_stats+0x37/0xf0 [i915]
> > [ 284.922549] [<ffffffffa00535f5>] i915_gem_object_info+0x265/0x490 [i915]
> > [ 284.922581] [<ffffffff81144491>] seq_read+0xe1/0x3b0
> > [ 284.922592] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
> > [ 284.922604] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
> > [ 284.922616] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
> > [ 284.922626] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
> > [ 284.922636] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
> > [ 284.922648]
> > -> #0 (&dev->filelist_mutex){+.+...}:
> > [ 284.922667] [<ffffffff810871fc>] __lock_acquire+0x10fc/0x1270
> > [ 284.922678] [<ffffffff81087710>] lock_acquire+0x60/0x80
> > [ 284.922689] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
> > [ 284.922701] [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
> > [ 284.922729] [<ffffffff81144491>] seq_read+0xe1/0x3b0
> > [ 284.922739] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
> > [ 284.922750] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
> > [ 284.922761] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
> > [ 284.922771] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
> > [ 284.922781] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
> > [ 284.922793]
> > [ 284.922793] other info that might help us debug this:
> > [ 284.922793]
> > [ 284.922809] Possible unsafe locking scenario:
> > [ 284.922809]
> > [ 284.922818] CPU0 CPU1
> > [ 284.922825] ---- ----
> > [ 284.922831] lock(&dev->struct_mutex);
> > [ 284.922842] lock(&dev->filelist_mutex);
> > [ 284.922854] lock(&dev->struct_mutex);
> > [ 284.922865] lock(&dev->filelist_mutex);
> > [ 284.922875]
> > [ 284.922875] *** DEADLOCK ***
> > [ 284.922875]
> > [ 284.922888] 3 locks held by cat/1197:
> > [ 284.922895] #0: (debugfs_srcu){......}, at: [<ffffffff811f7730>] full_proxy_read+0x0/0xb0
> > [ 284.922919] #1: (&p->lock){+.+.+.}, at: [<ffffffff811443e8>] seq_read+0x38/0x3b0
> > [ 284.922942] #2: (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
> > [ 284.922983]
>
> Do we have a regressing commit reference?
For an unlikely ABBA debugfs deadlock that no one reported?
1d2ac403ae3bfde7c50328ee0d39d3fb3d8d9823
drm: Protect dev->filelist with its own mutex
-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
* Re: [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info
2016-08-22 12:15 ` Chris Wilson
@ 2016-08-22 12:28 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2016-08-22 12:28 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Mon, 22 Aug 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Mon, Aug 22, 2016 at 03:09:48PM +0300, Jani Nikula wrote:
>>
>> On Mon, 22 Aug 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> > [ 284.922349] ======================================================
>> > [ 284.922355] [ INFO: possible circular locking dependency detected ]
>> > [ 284.922361] 4.8.0-rc2+ #430 Tainted: G W
>> > [ 284.922366] -------------------------------------------------------
>> > [ 284.922371] cat/1197 is trying to acquire lock:
>> > [ 284.922376] (&dev->filelist_mutex){+.+...}, at: [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
>> > [ 284.922423]
>> > [ 284.922423] but task is already holding lock:
>> > [ 284.922429] (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
>> > [ 284.922465]
>> > [ 284.922465] which lock already depends on the new lock.
>> > [ 284.922465]
>> > [ 284.922471]
>> > [ 284.922471] the existing dependency chain (in reverse order) is:
>> > [ 284.922477]
>> > -> #1 (&dev->struct_mutex){+.+.+.}:
>> > [ 284.922493] [<ffffffff81087710>] lock_acquire+0x60/0x80
>> > [ 284.922505] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
>> > [ 284.922520] [<ffffffffa004f877>] print_context_stats+0x37/0xf0 [i915]
>> > [ 284.922549] [<ffffffffa00535f5>] i915_gem_object_info+0x265/0x490 [i915]
>> > [ 284.922581] [<ffffffff81144491>] seq_read+0xe1/0x3b0
>> > [ 284.922592] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
>> > [ 284.922604] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
>> > [ 284.922616] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
>> > [ 284.922626] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
>> > [ 284.922636] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
>> > [ 284.922648]
>> > -> #0 (&dev->filelist_mutex){+.+...}:
>> > [ 284.922667] [<ffffffff810871fc>] __lock_acquire+0x10fc/0x1270
>> > [ 284.922678] [<ffffffff81087710>] lock_acquire+0x60/0x80
>> > [ 284.922689] [<ffffffff8143e96f>] mutex_lock_nested+0x5f/0x360
>> > [ 284.922701] [<ffffffffa0055ba2>] i915_ppgtt_info+0x82/0x390 [i915]
>> > [ 284.922729] [<ffffffff81144491>] seq_read+0xe1/0x3b0
>> > [ 284.922739] [<ffffffff811f77b3>] full_proxy_read+0x83/0xb0
>> > [ 284.922750] [<ffffffff8111ba03>] __vfs_read+0x23/0x110
>> > [ 284.922761] [<ffffffff8111c9b9>] vfs_read+0x89/0x110
>> > [ 284.922771] [<ffffffff8111dbf4>] SyS_read+0x44/0xa0
>> > [ 284.922781] [<ffffffff81442be9>] entry_SYSCALL_64_fastpath+0x1c/0xac
>> > [ 284.922793]
>> > [ 284.922793] other info that might help us debug this:
>> > [ 284.922793]
>> > [ 284.922809] Possible unsafe locking scenario:
>> > [ 284.922809]
>> > [ 284.922818] CPU0 CPU1
>> > [ 284.922825] ---- ----
>> > [ 284.922831] lock(&dev->struct_mutex);
>> > [ 284.922842] lock(&dev->filelist_mutex);
>> > [ 284.922854] lock(&dev->struct_mutex);
>> > [ 284.922865] lock(&dev->filelist_mutex);
>> > [ 284.922875]
>> > [ 284.922875] *** DEADLOCK ***
>> > [ 284.922875]
>> > [ 284.922888] 3 locks held by cat/1197:
>> > [ 284.922895] #0: (debugfs_srcu){......}, at: [<ffffffff811f7730>] full_proxy_read+0x0/0xb0
>> > [ 284.922919] #1: (&p->lock){+.+.+.}, at: [<ffffffff811443e8>] seq_read+0x38/0x3b0
>> > [ 284.922942] #2: (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0055b55>] i915_ppgtt_info+0x35/0x390 [i915]
>> > [ 284.922983]
>>
>> Do we have a regressing commit reference?
>
> For an unlikely ABBA debugfs deadlock that no one reported?
Of course, that one line in the commit message would have been
sufficient for me to not ask...
BR,
Jani.
>
> 1d2ac403ae3bfde7c50328ee0d39d3fb3d8d9823
> drm: Protect dev->filelist with its own mutex
>
> -Chris
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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-08-22 12:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 11:35 [PATCH] drm/i915: Fix nesting of filelist_mutex vs struct_mutex in i915_ppgtt_info Chris Wilson
2016-08-22 11:44 ` Joonas Lahtinen
2016-08-22 12:09 ` Jani Nikula
2016-08-22 12:15 ` Chris Wilson
2016-08-22 12:28 ` Jani Nikula
2016-08-22 12:11 ` ✗ Ro.CI.BAT: warning for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox