All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Show number of objects without client
@ 2018-04-19 14:16 Mika Kuoppala
  2018-04-19 14:55 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mika Kuoppala @ 2018-04-19 14:16 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eero Tamminen

Output the number of objects not tied to a client
or to a vma. This amount should be quite small and
on oom issues we can rule out significant bo leaks
quickly by inspecting these values. Note that we are not
fully accurate due to how we take and release the locks
during transversal of related lists.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Eero Tamminen <eero.t.tamminen@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e0274f41bc76..b1cbecfca716 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -354,8 +354,8 @@ static int per_file_stats(int id, void *ptr, void *data)
 			   stats.unbound); \
 } while (0)
 
-static void print_batch_pool_stats(struct seq_file *m,
-				   struct drm_i915_private *dev_priv)
+static unsigned int print_batch_pool_stats(struct seq_file *m,
+					   struct drm_i915_private *dev_priv)
 {
 	struct drm_i915_gem_object *obj;
 	struct file_stats stats;
@@ -375,6 +375,7 @@ static void print_batch_pool_stats(struct seq_file *m,
 	}
 
 	print_file_stats(m, "[k]batch pool", stats);
+	return stats.count;
 }
 
 static int per_file_ctx_stats(int id, void *ptr, void *data)
@@ -392,8 +393,8 @@ static int per_file_ctx_stats(int id, void *ptr, void *data)
 	return 0;
 }
 
-static void print_context_stats(struct seq_file *m,
-				struct drm_i915_private *dev_priv)
+static unsigned int print_context_stats(struct seq_file *m,
+					struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = &dev_priv->drm;
 	struct file_stats stats;
@@ -412,6 +413,7 @@ static void print_context_stats(struct seq_file *m,
 	mutex_unlock(&dev->struct_mutex);
 
 	print_file_stats(m, "[k]contexts", stats);
+	return stats.count;
 }
 
 static int i915_gem_object_info(struct seq_file *m, void *data)
@@ -422,7 +424,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
 	u32 count, mapped_count, purgeable_count, dpy_count, huge_count;
 	u64 size, mapped_size, purgeable_size, dpy_size, huge_size;
 	struct drm_i915_gem_object *obj;
-	unsigned int page_sizes = 0;
+	unsigned int page_sizes = 0, client_count = 0, vma_count = 0;
 	struct drm_file *file;
 	char buf[80];
 	int ret;
@@ -462,6 +464,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
 		}
 	}
 	seq_printf(m, "%u unbound objects, %llu bytes\n", count, size);
+	vma_count += count;
 
 	size = count = dpy_size = dpy_count = 0;
 	list_for_each_entry(obj, &dev_priv->mm.bound_list, mm.link) {
@@ -490,6 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
 		}
 	}
 	spin_unlock(&dev_priv->mm.obj_lock);
+	vma_count += count;
 
 	seq_printf(m, "%u bound objects, %llu bytes\n",
 		   count, size);
@@ -511,11 +515,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
 					buf, sizeof(buf)));
 
 	seq_putc(m, '\n');
-	print_batch_pool_stats(m, dev_priv);
+	client_count += print_batch_pool_stats(m, dev_priv);
 	mutex_unlock(&dev->struct_mutex);
 
 	mutex_lock(&dev->filelist_mutex);
-	print_context_stats(m, dev_priv);
+	client_count += print_context_stats(m, dev_priv);
 	list_for_each_entry_reverse(file, &dev->filelist, lhead) {
 		struct file_stats stats;
 		struct drm_i915_file_private *file_priv = file->driver_priv;
@@ -543,12 +547,18 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
 				request->ctx->pid : file->pid,
 				PIDTYPE_PID);
 		print_file_stats(m, task ? task->comm : "<unknown>", stats);
+		client_count += stats.count;
 		rcu_read_unlock();
 
 		mutex_unlock(&dev->struct_mutex);
 	}
 	mutex_unlock(&dev->filelist_mutex);
 
+	seq_printf(m, "\n%d objects without vma\n",
+		   dev_priv->mm.object_count - vma_count);
+	seq_printf(m, "%d objects without client\n",
+		   dev_priv->mm.object_count - client_count);
+
 	return 0;
 }
 
-- 
2.14.1

_______________________________________________
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: Show number of objects without client
  2018-04-19 14:16 [PATCH] drm/i915: Show number of objects without client Mika Kuoppala
@ 2018-04-19 14:55 ` Chris Wilson
  2018-04-19 15:34   ` Mika Kuoppala
  2018-04-19 15:01 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-04-19 21:13 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2018-04-19 14:55 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx; +Cc: Eero Tamminen

Quoting Mika Kuoppala (2018-04-19 15:16:16)
> Output the number of objects not tied to a client
> or to a vma. This amount should be quite small and
> on oom issues we can rule out significant bo leaks
> quickly by inspecting these values. Note that we are not
> fully accurate due to how we take and release the locks
> during transversal of related lists.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Eero Tamminen <eero.t.tamminen@intel.com>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index e0274f41bc76..b1cbecfca716 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -354,8 +354,8 @@ static int per_file_stats(int id, void *ptr, void *data)
>                            stats.unbound); \
>  } while (0)
>  
> -static void print_batch_pool_stats(struct seq_file *m,
> -                                  struct drm_i915_private *dev_priv)
> +static unsigned int print_batch_pool_stats(struct seq_file *m,
> +                                          struct drm_i915_private *dev_priv)
>  {
>         struct drm_i915_gem_object *obj;
>         struct file_stats stats;
> @@ -375,6 +375,7 @@ static void print_batch_pool_stats(struct seq_file *m,
>         }
>  
>         print_file_stats(m, "[k]batch pool", stats);
> +       return stats.count;
>  }
>  
>  static int per_file_ctx_stats(int id, void *ptr, void *data)
> @@ -392,8 +393,8 @@ static int per_file_ctx_stats(int id, void *ptr, void *data)
>         return 0;
>  }
>  
> -static void print_context_stats(struct seq_file *m,
> -                               struct drm_i915_private *dev_priv)
> +static unsigned int print_context_stats(struct seq_file *m,
> +                                       struct drm_i915_private *dev_priv)
>  {
>         struct drm_device *dev = &dev_priv->drm;
>         struct file_stats stats;
> @@ -412,6 +413,7 @@ static void print_context_stats(struct seq_file *m,
>         mutex_unlock(&dev->struct_mutex);
>  
>         print_file_stats(m, "[k]contexts", stats);
> +       return stats.count;
>  }
>  
>  static int i915_gem_object_info(struct seq_file *m, void *data)
> @@ -422,7 +424,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>         u32 count, mapped_count, purgeable_count, dpy_count, huge_count;
>         u64 size, mapped_size, purgeable_size, dpy_size, huge_size;
>         struct drm_i915_gem_object *obj;
> -       unsigned int page_sizes = 0;
> +       unsigned int page_sizes = 0, client_count = 0, vma_count = 0;
>         struct drm_file *file;
>         char buf[80];
>         int ret;
> @@ -462,6 +464,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>                 }
>         }
>         seq_printf(m, "%u unbound objects, %llu bytes\n", count, size);
> +       vma_count += count;
>  
>         size = count = dpy_size = dpy_count = 0;
>         list_for_each_entry(obj, &dev_priv->mm.bound_list, mm.link) {
> @@ -490,6 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>                 }
>         }
>         spin_unlock(&dev_priv->mm.obj_lock);
> +       vma_count += count;
>  
>         seq_printf(m, "%u bound objects, %llu bytes\n",
>                    count, size);
> @@ -511,11 +515,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>                                         buf, sizeof(buf)));
>  
>         seq_putc(m, '\n');
> -       print_batch_pool_stats(m, dev_priv);
> +       client_count += print_batch_pool_stats(m, dev_priv);
>         mutex_unlock(&dev->struct_mutex);
>  
>         mutex_lock(&dev->filelist_mutex);
> -       print_context_stats(m, dev_priv);
> +       client_count += print_context_stats(m, dev_priv);
>         list_for_each_entry_reverse(file, &dev->filelist, lhead) {
>                 struct file_stats stats;
>                 struct drm_i915_file_private *file_priv = file->driver_priv;
> @@ -543,12 +547,18 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>                                 request->ctx->pid : file->pid,
>                                 PIDTYPE_PID);
>                 print_file_stats(m, task ? task->comm : "<unknown>", stats);
> +               client_count += stats.count;
>                 rcu_read_unlock();
>  
>                 mutex_unlock(&dev->struct_mutex);
>         }
>         mutex_unlock(&dev->filelist_mutex);
>  
> +       seq_printf(m, "\n%d objects without vma\n",
> +                  dev_priv->mm.object_count - vma_count);

What does "without vma" mean? Instantiated but never used on the gpu, a
very small subset of unbound. I'm not sure if it has value and worry
that "without vma" is unclear internal language.

"%d unused objects (without any attached vma)" I think works better.

> +       seq_printf(m, "%d objects without client\n",
> +                  dev_priv->mm.object_count - client_count);

What does "without client" mean? What are you going to do when it is
negative (as computed it can legitimately be negative).
-Chris
_______________________________________________
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

* ✓ Fi.CI.BAT: success for drm/i915: Show number of objects without client
  2018-04-19 14:16 [PATCH] drm/i915: Show number of objects without client Mika Kuoppala
  2018-04-19 14:55 ` Chris Wilson
@ 2018-04-19 15:01 ` Patchwork
  2018-04-19 21:13 ` ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-04-19 15:01 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show number of objects without client
URL   : https://patchwork.freedesktop.org/series/41977/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4069 -> Patchwork_8755 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/41977/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_8755 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@basic-flip-vs-modeset:
      fi-cnl-y3:          PASS -> INCOMPLETE (fdo#105086)

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         PASS -> FAIL (fdo#104008)
      fi-glk-1:           SKIP -> INCOMPLETE (k.org#198133, fdo#103359)

    
    ==== Possible fixes ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         FAIL (fdo#102575) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
  fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (35 -> 32) ==

  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4069 -> Patchwork_8755

  CI_DRM_4069: 8136363fe770a1a51688172d5ba46a5017f76677 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8755: d1e9cd01619a872f2642503e1490c2184042f048 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit


== Linux commits ==

d1e9cd01619a drm/i915: Show number of objects without client

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8755/issues.html
_______________________________________________
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: Show number of objects without client
  2018-04-19 14:55 ` Chris Wilson
@ 2018-04-19 15:34   ` Mika Kuoppala
  2018-04-19 16:04     ` Chris Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Mika Kuoppala @ 2018-04-19 15:34 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Eero Tamminen

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Quoting Mika Kuoppala (2018-04-19 15:16:16)
>> Output the number of objects not tied to a client
>> or to a vma. This amount should be quite small and
>> on oom issues we can rule out significant bo leaks
>> quickly by inspecting these values. Note that we are not
>> fully accurate due to how we take and release the locks
>> during transversal of related lists.
>> 
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Eero Tamminen <eero.t.tamminen@intel.com>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_debugfs.c | 24 +++++++++++++++++-------
>>  1 file changed, 17 insertions(+), 7 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
>> index e0274f41bc76..b1cbecfca716 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -354,8 +354,8 @@ static int per_file_stats(int id, void *ptr, void *data)
>>                            stats.unbound); \
>>  } while (0)
>>  
>> -static void print_batch_pool_stats(struct seq_file *m,
>> -                                  struct drm_i915_private *dev_priv)
>> +static unsigned int print_batch_pool_stats(struct seq_file *m,
>> +                                          struct drm_i915_private *dev_priv)
>>  {
>>         struct drm_i915_gem_object *obj;
>>         struct file_stats stats;
>> @@ -375,6 +375,7 @@ static void print_batch_pool_stats(struct seq_file *m,
>>         }
>>  
>>         print_file_stats(m, "[k]batch pool", stats);
>> +       return stats.count;
>>  }
>>  
>>  static int per_file_ctx_stats(int id, void *ptr, void *data)
>> @@ -392,8 +393,8 @@ static int per_file_ctx_stats(int id, void *ptr, void *data)
>>         return 0;
>>  }
>>  
>> -static void print_context_stats(struct seq_file *m,
>> -                               struct drm_i915_private *dev_priv)
>> +static unsigned int print_context_stats(struct seq_file *m,
>> +                                       struct drm_i915_private *dev_priv)
>>  {
>>         struct drm_device *dev = &dev_priv->drm;
>>         struct file_stats stats;
>> @@ -412,6 +413,7 @@ static void print_context_stats(struct seq_file *m,
>>         mutex_unlock(&dev->struct_mutex);
>>  
>>         print_file_stats(m, "[k]contexts", stats);
>> +       return stats.count;
>>  }
>>  
>>  static int i915_gem_object_info(struct seq_file *m, void *data)
>> @@ -422,7 +424,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>>         u32 count, mapped_count, purgeable_count, dpy_count, huge_count;
>>         u64 size, mapped_size, purgeable_size, dpy_size, huge_size;
>>         struct drm_i915_gem_object *obj;
>> -       unsigned int page_sizes = 0;
>> +       unsigned int page_sizes = 0, client_count = 0, vma_count = 0;
>>         struct drm_file *file;
>>         char buf[80];
>>         int ret;
>> @@ -462,6 +464,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>>                 }
>>         }
>>         seq_printf(m, "%u unbound objects, %llu bytes\n", count, size);
>> +       vma_count += count;
>>  
>>         size = count = dpy_size = dpy_count = 0;
>>         list_for_each_entry(obj, &dev_priv->mm.bound_list, mm.link) {
>> @@ -490,6 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>>                 }
>>         }
>>         spin_unlock(&dev_priv->mm.obj_lock);
>> +       vma_count += count;
>>  
>>         seq_printf(m, "%u bound objects, %llu bytes\n",
>>                    count, size);
>> @@ -511,11 +515,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>>                                         buf, sizeof(buf)));
>>  
>>         seq_putc(m, '\n');
>> -       print_batch_pool_stats(m, dev_priv);
>> +       client_count += print_batch_pool_stats(m, dev_priv);
>>         mutex_unlock(&dev->struct_mutex);
>>  
>>         mutex_lock(&dev->filelist_mutex);
>> -       print_context_stats(m, dev_priv);
>> +       client_count += print_context_stats(m, dev_priv);
>>         list_for_each_entry_reverse(file, &dev->filelist, lhead) {
>>                 struct file_stats stats;
>>                 struct drm_i915_file_private *file_priv = file->driver_priv;
>> @@ -543,12 +547,18 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
>>                                 request->ctx->pid : file->pid,
>>                                 PIDTYPE_PID);
>>                 print_file_stats(m, task ? task->comm : "<unknown>", stats);
>> +               client_count += stats.count;
>>                 rcu_read_unlock();
>>  
>>                 mutex_unlock(&dev->struct_mutex);
>>         }
>>         mutex_unlock(&dev->filelist_mutex);
>>  
>> +       seq_printf(m, "\n%d objects without vma\n",
>> +                  dev_priv->mm.object_count - vma_count);
>
> What does "without vma" mean? Instantiated but never used on the gpu, a
> very small subset of unbound. I'm not sure if it has value and worry
> that "without vma" is unclear internal language.
>

Noticed that after reboot on a system we had 3 objects
without usage. Thought it could add some value as a noticing
leaks.

> "%d unused objects (without any attached vma)" I think works better.

Or just "unused objects" ?

>
>> +       seq_printf(m, "%d objects without client\n",
>> +                  dev_priv->mm.object_count - client_count);
>
> What does "without client" mean? What are you going to do when it is
> negative (as computed it can legitimately be negative).

"objects without handle" better? or "unassociated objects" ?

Negative would be wrong, so the tracking of batchbool/context
must be wrong in here then.

-Mika
_______________________________________________
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: Show number of objects without client
  2018-04-19 15:34   ` Mika Kuoppala
@ 2018-04-19 16:04     ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-04-19 16:04 UTC (permalink / raw)
  To: Mika Kuoppala, intel-gfx; +Cc: Eero Tamminen

Quoting Mika Kuoppala (2018-04-19 16:34:27)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Quoting Mika Kuoppala (2018-04-19 15:16:16)
> >> Output the number of objects not tied to a client
> >> or to a vma. This amount should be quite small and
> >> on oom issues we can rule out significant bo leaks
> >> quickly by inspecting these values. Note that we are not
> >> fully accurate due to how we take and release the locks
> >> during transversal of related lists.
> >> 
> >> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> >> Cc: Eero Tamminen <eero.t.tamminen@intel.com>
> >> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/i915_debugfs.c | 24 +++++++++++++++++-------
> >>  1 file changed, 17 insertions(+), 7 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> >> index e0274f41bc76..b1cbecfca716 100644
> >> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> >> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> >> @@ -354,8 +354,8 @@ static int per_file_stats(int id, void *ptr, void *data)
> >>                            stats.unbound); \
> >>  } while (0)
> >>  
> >> -static void print_batch_pool_stats(struct seq_file *m,
> >> -                                  struct drm_i915_private *dev_priv)
> >> +static unsigned int print_batch_pool_stats(struct seq_file *m,
> >> +                                          struct drm_i915_private *dev_priv)
> >>  {
> >>         struct drm_i915_gem_object *obj;
> >>         struct file_stats stats;
> >> @@ -375,6 +375,7 @@ static void print_batch_pool_stats(struct seq_file *m,
> >>         }
> >>  
> >>         print_file_stats(m, "[k]batch pool", stats);
> >> +       return stats.count;
> >>  }
> >>  
> >>  static int per_file_ctx_stats(int id, void *ptr, void *data)
> >> @@ -392,8 +393,8 @@ static int per_file_ctx_stats(int id, void *ptr, void *data)
> >>         return 0;
> >>  }
> >>  
> >> -static void print_context_stats(struct seq_file *m,
> >> -                               struct drm_i915_private *dev_priv)
> >> +static unsigned int print_context_stats(struct seq_file *m,
> >> +                                       struct drm_i915_private *dev_priv)
> >>  {
> >>         struct drm_device *dev = &dev_priv->drm;
> >>         struct file_stats stats;
> >> @@ -412,6 +413,7 @@ static void print_context_stats(struct seq_file *m,
> >>         mutex_unlock(&dev->struct_mutex);
> >>  
> >>         print_file_stats(m, "[k]contexts", stats);
> >> +       return stats.count;
> >>  }
> >>  
> >>  static int i915_gem_object_info(struct seq_file *m, void *data)
> >> @@ -422,7 +424,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
> >>         u32 count, mapped_count, purgeable_count, dpy_count, huge_count;
> >>         u64 size, mapped_size, purgeable_size, dpy_size, huge_size;
> >>         struct drm_i915_gem_object *obj;
> >> -       unsigned int page_sizes = 0;
> >> +       unsigned int page_sizes = 0, client_count = 0, vma_count = 0;
> >>         struct drm_file *file;
> >>         char buf[80];
> >>         int ret;
> >> @@ -462,6 +464,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
> >>                 }
> >>         }
> >>         seq_printf(m, "%u unbound objects, %llu bytes\n", count, size);
> >> +       vma_count += count;
> >>  
> >>         size = count = dpy_size = dpy_count = 0;
> >>         list_for_each_entry(obj, &dev_priv->mm.bound_list, mm.link) {
> >> @@ -490,6 +493,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
> >>                 }
> >>         }
> >>         spin_unlock(&dev_priv->mm.obj_lock);
> >> +       vma_count += count;
> >>  
> >>         seq_printf(m, "%u bound objects, %llu bytes\n",
> >>                    count, size);
> >> @@ -511,11 +515,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
> >>                                         buf, sizeof(buf)));
> >>  
> >>         seq_putc(m, '\n');
> >> -       print_batch_pool_stats(m, dev_priv);
> >> +       client_count += print_batch_pool_stats(m, dev_priv);
> >>         mutex_unlock(&dev->struct_mutex);
> >>  
> >>         mutex_lock(&dev->filelist_mutex);
> >> -       print_context_stats(m, dev_priv);
> >> +       client_count += print_context_stats(m, dev_priv);
> >>         list_for_each_entry_reverse(file, &dev->filelist, lhead) {
> >>                 struct file_stats stats;
> >>                 struct drm_i915_file_private *file_priv = file->driver_priv;
> >> @@ -543,12 +547,18 @@ static int i915_gem_object_info(struct seq_file *m, void *data)
> >>                                 request->ctx->pid : file->pid,
> >>                                 PIDTYPE_PID);
> >>                 print_file_stats(m, task ? task->comm : "<unknown>", stats);
> >> +               client_count += stats.count;
> >>                 rcu_read_unlock();
> >>  
> >>                 mutex_unlock(&dev->struct_mutex);
> >>         }
> >>         mutex_unlock(&dev->filelist_mutex);
> >>  
> >> +       seq_printf(m, "\n%d objects without vma\n",
> >> +                  dev_priv->mm.object_count - vma_count);
> >
> > What does "without vma" mean? Instantiated but never used on the gpu, a
> > very small subset of unbound. I'm not sure if it has value and worry
> > that "without vma" is unclear internal language.
> >
> 
> Noticed that after reboot on a system we had 3 objects
> without usage. Thought it could add some value as a noticing
> leaks.
> 
> > "%d unused objects (without any attached vma)" I think works better.
> 
> Or just "unused objects" ?

They may still be used as a container for user memory, they are just not
used in the GTT. Getting the meaning across in a succinct manner is
tricky.

> >> +       seq_printf(m, "%d objects without client\n",
> >> +                  dev_priv->mm.object_count - client_count);
> >
> > What does "without client" mean? What are you going to do when it is
> > negative (as computed it can legitimately be negative).
> 
> "objects without handle" better? or "unassociated objects" ?
> 
> Negative would be wrong, so the tracking of batchbool/context
> must be wrong in here then.

Not quite, just that objects may be referenced by more than client and so
client_count may be greater than the total number of objects.
-Chris
_______________________________________________
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

* ✓ Fi.CI.IGT: success for drm/i915: Show number of objects without client
  2018-04-19 14:16 [PATCH] drm/i915: Show number of objects without client Mika Kuoppala
  2018-04-19 14:55 ` Chris Wilson
  2018-04-19 15:01 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-04-19 21:13 ` Patchwork
  2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-04-19 21:13 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show number of objects without client
URL   : https://patchwork.freedesktop.org/series/41977/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4069_full -> Patchwork_8755_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_8755_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_8755_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/41977/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_8755_full:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-bsd2:
      shard-kbl:          PASS -> SKIP

    igt@gem_mocs_settings@mocs-rc6-dirty-render:
      shard-kbl:          SKIP -> PASS +1

    igt@kms_mmap_write_crc:
      shard-glk:          SKIP -> PASS +32

    igt@kms_vblank@pipe-b-wait-forked:
      shard-glk:          PASS -> SKIP +36

    
== Known issues ==

  Here are the changes found in Patchwork_8755_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@drv_suspend@forcewake:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665)

    igt@kms_flip@dpms-vs-vblank-race-interruptible:
      shard-glk:          PASS -> FAIL (fdo#103060)

    igt@kms_flip@modeset-vs-vblank-race-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#103060)

    igt@kms_hdmi_inject@inject-audio:
      shard-glk:          PASS -> FAIL (fdo#102370)

    igt@kms_sysfs_edid_timing:
      shard-apl:          PASS -> WARN (fdo#100047)

    igt@prime_vgem@basic-fence-flip:
      shard-glk:          PASS -> FAIL (fdo#104008)

    
    ==== Possible fixes ====

    igt@kms_cursor_legacy@flip-vs-cursor-atomic:
      shard-hsw:          FAIL (fdo#102670) -> PASS

    igt@kms_flip@2x-plain-flip-ts-check-interruptible:
      shard-hsw:          FAIL (fdo#100368) -> PASS +1

    igt@kms_flip@blocking-absolute-wf_vblank-interruptible:
      shard-glk:          FAIL (fdo#106134) -> PASS

    igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible:
      shard-glk:          FAIL (fdo#100368) -> SKIP

    igt@kms_flip@flip-vs-wf_vblank-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@wf_vblank-ts-check-interruptible:
      shard-glk:          FAIL (fdo#103933) -> SKIP

    igt@kms_setmode@basic:
      shard-glk:          FAIL (fdo#99912) -> PASS

    igt@kms_vblank@pipe-a-accuracy-idle:
      shard-hsw:          FAIL (fdo#102583) -> PASS

    
    ==== Warnings ====

    igt@kms_sysfs_edid_timing:
      shard-glk:          WARN (fdo#100047) -> FAIL (fdo#100047)

    
  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102370 https://bugs.freedesktop.org/show_bug.cgi?id=102370
  fdo#102583 https://bugs.freedesktop.org/show_bug.cgi?id=102583
  fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#103933 https://bugs.freedesktop.org/show_bug.cgi?id=103933
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106134 https://bugs.freedesktop.org/show_bug.cgi?id=106134
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 5) ==

  Missing    (1): shard-glkb 


== Build changes ==

    * Linux: CI_DRM_4069 -> Patchwork_8755

  CI_DRM_4069: 8136363fe770a1a51688172d5ba46a5017f76677 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8755: d1e9cd01619a872f2642503e1490c2184042f048 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8755/shards.html
_______________________________________________
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:[~2018-04-19 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 14:16 [PATCH] drm/i915: Show number of objects without client Mika Kuoppala
2018-04-19 14:55 ` Chris Wilson
2018-04-19 15:34   ` Mika Kuoppala
2018-04-19 16:04     ` Chris Wilson
2018-04-19 15:01 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-19 21:13 ` ✓ Fi.CI.IGT: " Patchwork

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.