From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/37] drm/i915: Reduce i915_gem_objects to only show object information
Date: Fri, 12 Aug 2016 10:21:09 +0300 [thread overview]
Message-ID: <1470986469.3709.0.camel@linux.intel.com> (raw)
In-Reply-To: <1470984867-7132-7-git-send-email-chris@chris-wilson.co.uk>
On pe, 2016-08-12 at 07:53 +0100, Chris Wilson wrote:
> No longer is knowing how much of the GTT (both mappable aperture and
> beyond) relevant, and the output clutters the real information - that is
> how many objects are allocated and bound (and by who) so that we can
> quickly grasp if there is a leak.
>
> v2: Relent, and rename pinned to indicate display only. Since the
> display objects are semi-static and are of variable size, they are the
> interesting objects to watch over time for aperture leaking. The other
> pins are either static (such as the scratch page) or very short lived
> (such as execbuf) and not part of the precious GGTT.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 100 ++++++++++--------------------------
> 1 file changed, 28 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index c535c4c2f7af..fd028953453d 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -269,17 +269,6 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
> return 0;
> }
>
> -#define count_objects(list, member) do { \
> - list_for_each_entry(obj, list, member) { \
> - size += i915_gem_obj_total_ggtt_size(obj); \
> - ++count; \
> - if (obj->map_and_fenceable) { \
> - mappable_size += i915_gem_obj_ggtt_size(obj); \
> - ++mappable_count; \
> - } \
> - } \
> -} while (0)
> -
> struct file_stats {
> struct drm_i915_file_private *file_priv;
> unsigned long count;
> @@ -394,30 +383,16 @@ static void print_context_stats(struct seq_file *m,
> print_file_stats(m, "[k]contexts", stats);
> }
>
> -#define count_vmas(list, member) do { \
> - list_for_each_entry(vma, list, member) { \
> - size += i915_gem_obj_total_ggtt_size(vma->obj); \
> - ++count; \
> - if (vma->obj->map_and_fenceable) { \
> - mappable_size += i915_gem_obj_ggtt_size(vma->obj); \
> - ++mappable_count; \
> - } \
> - } \
> -} while (0)
> -
> static int i915_gem_object_info(struct seq_file *m, void* data)
> {
> struct drm_info_node *node = m->private;
> struct drm_device *dev = node->minor->dev;
> struct drm_i915_private *dev_priv = to_i915(dev);
> struct i915_ggtt *ggtt = &dev_priv->ggtt;
> - u32 count, mappable_count, purgeable_count;
> - u64 size, mappable_size, purgeable_size;
> - unsigned long pin_mapped_count = 0, pin_mapped_purgeable_count = 0;
> - u64 pin_mapped_size = 0, pin_mapped_purgeable_size = 0;
> + u32 count, mapped_count, purgeable_count, dpy_count;
> + u64 size, mapped_size, purgeable_size, dpy_size;
> struct drm_i915_gem_object *obj;
> struct drm_file *file;
> - struct i915_vma *vma;
> int ret;
>
> ret = mutex_lock_interruptible(&dev->struct_mutex);
> @@ -428,70 +403,51 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
> dev_priv->mm.object_count,
> dev_priv->mm.object_memory);
>
> - size = count = mappable_size = mappable_count = 0;
> - count_objects(&dev_priv->mm.bound_list, global_list);
> - seq_printf(m, "%u [%u] objects, %llu [%llu] bytes in gtt\n",
> - count, mappable_count, size, mappable_size);
> -
> - size = count = mappable_size = mappable_count = 0;
> - count_vmas(&ggtt->base.active_list, vm_link);
> - seq_printf(m, " %u [%u] active objects, %llu [%llu] bytes\n",
> - count, mappable_count, size, mappable_size);
> -
> - size = count = mappable_size = mappable_count = 0;
> - count_vmas(&ggtt->base.inactive_list, vm_link);
> - seq_printf(m, " %u [%u] inactive objects, %llu [%llu] bytes\n",
> - count, mappable_count, size, mappable_size);
> -
> size = count = purgeable_size = purgeable_count = 0;
> list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) {
> - size += obj->base.size, ++count;
> - if (obj->madv == I915_MADV_DONTNEED)
> - purgeable_size += obj->base.size, ++purgeable_count;
> + size += obj->base.size;
> + ++count;
> +
> + if (obj->madv == I915_MADV_DONTNEED) {
> + purgeable_size += obj->base.size;
> + ++purgeable_count;
> + }
> +
> if (obj->mapping) {
> - pin_mapped_count++;
> - pin_mapped_size += obj->base.size;
> - if (obj->pages_pin_count == 0) {
> - pin_mapped_purgeable_count++;
> - pin_mapped_purgeable_size += obj->base.size;
> - }
> + mapped_count++;
> + mapped_size += obj->base.size;
> }
> }
> seq_printf(m, "%u unbound objects, %llu bytes\n", count, size);
>
> - size = count = mappable_size = mappable_count = 0;
> + size = count = dpy_size = dpy_count = 0;
> list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
> - if (obj->fault_mappable) {
> - size += i915_gem_obj_ggtt_size(obj);
> - ++count;
> - }
> + size += obj->base.size;
> + ++count;
> +
> if (obj->pin_display) {
> - mappable_size += i915_gem_obj_ggtt_size(obj);
> - ++mappable_count;
> + dpy_size += obj->base.size;
> + ++dpy_count;
> }
> +
> if (obj->madv == I915_MADV_DONTNEED) {
> purgeable_size += obj->base.size;
> ++purgeable_count;
> }
> +
> if (obj->mapping) {
> - pin_mapped_count++;
> - pin_mapped_size += obj->base.size;
> - if (obj->pages_pin_count == 0) {
> - pin_mapped_purgeable_count++;
> - pin_mapped_purgeable_size += obj->base.size;
> - }
> + mapped_count++;
> + mapped_size += obj->base.size;
> }
> }
> + seq_printf(m, "%u bound objects, %llu bytes\n",
> + count, size);
> seq_printf(m, "%u purgeable objects, %llu bytes\n",
> purgeable_count, purgeable_size);
> - seq_printf(m, "%u pinned mappable objects, %llu bytes\n",
> - mappable_count, mappable_size);
> - seq_printf(m, "%u fault mappable objects, %llu bytes\n",
> - count, size);
> - seq_printf(m,
> - "%lu [%lu] pin mapped objects, %llu [%llu] bytes [purgeable]\n",
> - pin_mapped_count, pin_mapped_purgeable_count,
> - pin_mapped_size, pin_mapped_purgeable_size);
> + seq_printf(m, "%u mapped objects, %llu bytes\n",
> + mapped_count, mapped_size);
> + seq_printf(m, "%u display objects (pinned), %llu bytes\n",
> + dpy_count, dpy_size);
>
> seq_printf(m, "%llu [%llu] gtt total\n",
> ggtt->base.total, ggtt->mappable_end - ggtt->base.start);
--
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
next prev parent reply other threads:[~2016-08-12 7:21 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 6:53 [PATCH 01/37] drm/i915: Record the position of the start of the request Chris Wilson
2016-08-12 6:53 ` [PATCH 02/37] drm/i915: Reduce amount of duplicate buffer information captured on error Chris Wilson
2016-08-12 6:53 ` [PATCH 03/37] drm/i915: Stop the machine whilst capturing the GPU crash dump Chris Wilson
2016-08-12 6:53 ` [PATCH 04/37] drm/i915: Store the active context object on all engines upon error Chris Wilson
2016-08-12 6:53 ` [PATCH 05/37] drm/i915: Remove inactive/active list from debugfs Chris Wilson
2016-08-12 6:53 ` [PATCH 06/37] drm/i915: Focus debugfs/i915_gem_pinned to show only display pins Chris Wilson
2016-08-12 6:53 ` [PATCH 07/37] drm/i915: Reduce i915_gem_objects to only show object information Chris Wilson
2016-08-12 7:21 ` Joonas Lahtinen [this message]
2016-08-12 6:53 ` [PATCH 08/37] drm/i915: Record the device capabilities at the time of a hang Chris Wilson
2016-08-12 7:42 ` Joonas Lahtinen
2016-08-12 6:53 ` [PATCH 09/37] drm/i915: Remove redundant WARN_ON from __i915_add_request() Chris Wilson
2016-08-12 6:54 ` [PATCH 10/37] drm/i915: Always set the vma->pages Chris Wilson
2016-08-12 7:48 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 11/37] drm/i915: Create a VMA for an object Chris Wilson
2016-08-12 6:54 ` [PATCH 12/37] drm/i915: Add fetch_and_zero() macro Chris Wilson
2016-08-12 7:55 ` Joonas Lahtinen
2016-08-12 8:05 ` Chris Wilson
2016-08-12 6:54 ` [PATCH 13/37] drm/i915: Add convenience wrappers for vma's object get/put Chris Wilson
2016-08-12 8:03 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 14/37] drm/i915: Track pinned vma inside guc Chris Wilson
2016-08-12 9:42 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 15/37] drm/i915: Convert fence computations to use vma directly Chris Wilson
2016-08-12 6:54 ` [PATCH 16/37] drm/i915: Use VMA directly for checking tiling parameters Chris Wilson
2016-08-12 8:16 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 17/37] drm/i915: Use VMA as the primary object for context state Chris Wilson
2016-08-12 6:54 ` [PATCH 18/37] drm/i915: Only clflush the context object when binding Chris Wilson
2016-08-12 8:19 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 19/37] drm/i915: Move assertion for iomap access to i915_vma_pin_iomap Chris Wilson
2016-08-12 8:21 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 20/37] drm/i915: Use VMA for ringbuffer tracking Chris Wilson
2016-08-12 8:34 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 21/37] drm/i915: Use VMA for scratch page tracking Chris Wilson
2016-08-12 6:54 ` [PATCH 22/37] drm/i915: Move common scratch allocation/destroy to intel_engine_cs.c Chris Wilson
2016-08-12 8:40 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 23/37] drm/i915: Move common seqno reset " Chris Wilson
2016-08-12 8:42 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 24/37] drm/i915/overlay: Use VMA as the primary tracker for images Chris Wilson
2016-08-12 6:54 ` [PATCH 25/37] drm/i915: Use VMA as the primary tracker for semaphore page Chris Wilson
2016-08-12 6:54 ` [PATCH 26/37] drm/i915: Use VMA for render state page tracking Chris Wilson
2016-08-12 6:54 ` [PATCH 27/37] drm/i915: Use VMA for wa_ctx tracking Chris Wilson
2016-08-12 6:54 ` [PATCH 28/37] drm/i915: Consolidate i915_vma_unpin_and_release() Chris Wilson
2016-08-12 8:45 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 29/37] drm/i915: Track pinned VMA Chris Wilson
2016-08-12 8:53 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 30/37] drm/i915: Introduce i915_ggtt_offset() Chris Wilson
2016-08-12 9:01 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 31/37] drm/i915: Print the batchbuffer offset next to BBADDR in error state Chris Wilson
2016-08-12 6:54 ` [PATCH 32/37] drm/i915: Move debug only per-request pid tracking from request to ctx Chris Wilson
2016-08-12 9:03 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 33/37] drm/i915: Only record active and pending requests upon a GPU hang Chris Wilson
2016-08-12 12:39 ` Matthew Auld
2016-08-12 12:49 ` Chris Wilson
2016-08-12 6:54 ` [PATCH 34/37] drm/i915: Record the RING_MODE register for post-mortem debugging Chris Wilson
2016-08-12 9:07 ` Joonas Lahtinen
2016-08-12 6:54 ` [PATCH 35/37] drm/i915: Always use the GTT for error capture Chris Wilson
2016-08-12 6:54 ` [PATCH 36/37] drm/i915: Consolidate error object printing Chris Wilson
2016-08-12 6:54 ` [PATCH 37/37] drm/i915: Compress GPU objects in error state Chris Wilson
2016-08-12 7:27 ` ✗ Ro.CI.BAT: failure for series starting with [01/37] drm/i915: Record the position of the start of the request Patchwork
2016-08-12 9:45 ` [PATCH 01/37] " Joonas Lahtinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470986469.3709.0.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox