drm/i915/lmem: debugfs for LMEM details
Subsystems (2)
PATCH 1/1 drm/i915/lmem: debugfs for LMEM details
From: Lukasz Fiedorowicz <[email protected]>
Debugfs i915_gem_object is extended to enable the IGTs to detect the LMEM's availability and the total size of LMEM.
--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++++- drivers/gpu/drm/i915/intel_memory_region.c | 5 ++++- drivers/gpu/drm/i915/intel_memory_region.h | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -1
@@ -373,7 +373,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)atomic_read (&i915->mm.free_count), i915->mm.shrink_memory); -seq_putc (m,'\n' ); +if (HAS_LMEM (i915)) { +seq_printf (m,"LMEM total: %llu bytes, available %llu bytes\n" , + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->total, + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->avail); + }print_context_stats (m, i915);
drivers/gpu/drm/i915/intel_memory_region.c +4 -1
@@ -37,7 +37,7 @@ __intel_memory_region_put_pages_buddy(struct intel_memory_region *mem, struct list_head *blocks) {mutex_lock (&mem->mm_lock); -intel_memory_region_free_pages (mem, blocks); + mem->avail +=intel_memory_region_free_pages (mem, blocks);mutex_unlock (&mem->mm_lock); }
@@ -106,6 +106,7 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem,break ; }while (1 ); + mem->avail -= size;mutex_unlock (&mem->mm_lock);return 0 ;
@@ -164,6 +165,8 @@ intel_memory_region_create(struct drm_i915_private *i915, mem->io_start = io_start; mem->min_page_size = min_page_size; mem->ops = ops; + mem->total = size; + mem->avail = mem->total;mutex_init (&mem->objects.lock);INIT_LIST_HEAD (&mem->objects.list);
drivers/gpu/drm/i915/intel_memory_region.h +3 -0
@@ -94,6 +94,9 @@ struct intel_memory_region {struct list_head list;struct list_head purgeable; } objects; + +resource_size_t total; +resource_size_t avail; };int intel_memory_region_init_buddy (struct intel_memory_region *mem);
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Ramalingam C (2019-12-20 12:51:16)
Quoted 22 lines
From: Lukasz Fiedorowicz <[email protected]>
Debugfs
i915_gem_objectis extended to enable the IGTs to detect the LMEM's availability and the total size of LMEM.Signed-off-by Lukasz Fiedorowicz <[email protected]>Signed-off-by Matthew Auld <[email protected]>Signed-off-by Stuart Summers <[email protected]>Signed-off-by Ramalingam C <[email protected]>Cc Joonas Lahtinen <[email protected]>cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++++- drivers/gpu/drm/i915/intel_memory_region.c | 5 ++++- drivers/gpu/drm/i915/intel_memory_region.h | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0
drivers/gpu/drm/i915/i915_debugfs.c static int i915_gem_object_info(struct seq_file *m, void *data) · line 379
Quoted 8 lines
drivers/gpu/drm/i915/i915_debugfs.c +4
-1@@ -373,7 +373,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)atomic_read (&i915->mm.free_count), i915->mm.shrink_memory); -seq_putc (m,'\n' ); +if (HAS_LMEM (i915)) { +seq_printf (m,"LMEM total: %llu bytes, available %llu bytes\n" , + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->total, + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->avail);
%pa for resource_size_t
Use READ_ONCE() to indicate to the reader these are being accessed outside of the mem->lock.
Quoted 18 lines
drivers/gpu/drm/i915/i915_debugfs.c +1
-0+ }print_context_stats (m, i915);drivers/gpu/drm/i915/intel_memory_region.c +1
-1@@ -37,7 +37,7 @@ __intel_memory_region_put_pages_buddy(struct intel_memory_region *mem, struct list_head *blocks) {mutex_lock (&mem->mm_lock); -intel_memory_region_free_pages (mem, blocks); + mem->avail +=intel_memory_region_free_pages (mem, blocks);mutex_unlock (&mem->mm_lock); }
drivers/gpu/drm/i915/intel_memory_region.c __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem, · line 111
Quoted 6 lines
drivers/gpu/drm/i915/intel_memory_region.c +1
-0@@ -106,6 +106,7 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem,break ; }while (1 ); + mem->avail -= size;mutex_unlock (&mem->mm_lock);return 0 ;
These two look nice and symmetrical.
Quoted 15 lines
drivers/gpu/drm/i915/intel_memory_region.c +2
-0@@ -164,6 +165,8 @@ intel_memory_region_create(struct drm_i915_private *i915, mem->io_start = io_start; mem->min_page_size = min_page_size; mem->ops = ops; + mem->total = size; + mem->avail = mem->total;mutex_init (&mem->objects.lock);INIT_LIST_HEAD (&mem->objects.list);drivers/gpu/drm/i915/intel_memory_region.h +0
-0
drivers/gpu/drm/i915/intel_memory_region.h struct intel_memory_region { · line 99
Quoted 6 lines
drivers/gpu/drm/i915/intel_memory_region.h +3
-0@@ -94,6 +94,9 @@ struct intel_memory_region {struct list_head list;struct list_head purgeable; } objects; + +resource_size_t total; +resource_size_t avail;
Sensible placement? There'll be one less hole if you put these next to the other resource_size_t
Fix the nits, and
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 26 lines · Chris Wilson
Quoting Ramalingam C (2019-12-20 12:51:16)
Quoted 25 lines
From: Lukasz Fiedorowicz <[email protected]>
Debugfs
i915_gem_objectis extended to enable the IGTs to detect the LMEM's availability and the total size of LMEM.Signed-off-by Lukasz Fiedorowicz <[email protected]>Signed-off-by Matthew Auld <[email protected]>Signed-off-by Stuart Summers <[email protected]>Signed-off-by Ramalingam C <[email protected]>Cc Joonas Lahtinen <[email protected]>cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++++- drivers/gpu/drm/i915/intel_memory_region.c | 5 ++++- drivers/gpu/drm/i915/intel_memory_region.h | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -373,7 +373,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)atomic_read (&i915->mm.free_count), i915->mm.shrink_memory);
Quoted 8 lines
drivers/gpu/drm/i915/i915_debugfs.c static int i915_gem_object_info(struct seq_file *m, void *data) · line 379
Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs.c +4
-1-seq_putc (m,'\n' ); +if (HAS_LMEM (i915)) { +seq_printf (m,"LMEM total: %llu bytes, available %llu bytes\n" , + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->total, + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->avail);%pa for
resource_size_t
with READ_ONCE(i915->mm.regions[INTEL_REGION_LMEM]->total) %pa is not going well. Getting -Werror=format=. %llu is compiling without any warnings.
Quoted 38 lines
Use
READ_ONCE()to indicate to the reader these are being accessed outside of themem->lock.Quoted 18 lines
drivers/gpu/drm/i915/i915_debugfs.c +1
-0+ }print_context_stats (m, i915);drivers/gpu/drm/i915/intel_memory_region.c +1
-1@@ -37,7 +37,7 @@ __intel_memory_region_put_pages_buddy(struct intel_memory_region *mem, struct list_head *blocks) {mutex_lock (&mem->mm_lock); -intel_memory_region_free_pages (mem, blocks); + mem->avail +=intel_memory_region_free_pages (mem, blocks);mutex_unlock (&mem->mm_lock); }drivers/gpu/drm/i915/intel_memory_region.c __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem, · line 111
Quoted 6 lines
drivers/gpu/drm/i915/intel_memory_region.c +1
-0@@ -106,6 +106,7 @@ __intel_memory_region_get_pages_buddy(struct intel_memory_region *mem,break ; }while (1 ); + mem->avail -= size;mutex_unlock (&mem->mm_lock);return 0 ;These two look nice and symmetrical.
Quoted 8 lines
drivers/gpu/drm/i915/intel_memory_region.c +2
-0@@ -164,6 +165,8 @@ intel_memory_region_create(struct drm_i915_private *i915, mem->io_start = io_start; mem->min_page_size = min_page_size; mem->ops = ops; + mem->total = size; + mem->avail = mem->total;
Quoted 16 lines
drivers/gpu/drm/i915/intel_memory_region.h struct intel_memory_region { · line 99
Quoted 13 lines
drivers/gpu/drm/i915/intel_memory_region.c +0
-0mutex_init (&mem->objects.lock);INIT_LIST_HEAD (&mem->objects.list);drivers/gpu/drm/i915/intel_memory_region.h +3
-0@@ -94,6 +94,9 @@ struct intel_memory_region {struct list_head list;struct list_head purgeable; } objects; + +resource_size_t total; +resource_size_t avail;Sensible placement? There'll be one less hole if you put these next to the other
resource_size_t
done.
Quoted 3 lines
Fix the nits, and
Reviewed-by Chris Wilson <[email protected]>
Thank you.
-Ram
Quoted 1 line
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Ramalingam C (2019-12-20 15:08:25)
Quoted 35 lines · Chris Wilson
Quoted 26 lines
Quoting Ramalingam C (2019-12-20 12:51:16)
Quoted 25 lines
From: Lukasz Fiedorowicz <[email protected]>
Debugfs
i915_gem_objectis extended to enable the IGTs to detect the LMEM's availability and the total size of LMEM.Signed-off-by Lukasz Fiedorowicz <[email protected]>Signed-off-by Matthew Auld <[email protected]>Signed-off-by Stuart Summers <[email protected]>Signed-off-by Ramalingam C <[email protected]>Cc Joonas Lahtinen <[email protected]>cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 6 +++++- drivers/gpu/drm/i915/intel_memory_region.c | 5 ++++- drivers/gpu/drm/i915/intel_memory_region.h | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +0
-0@@ -373,7 +373,11 @@ static int i915_gem_object_info(struct seq_file *m, void *data)atomic_read (&i915->mm.free_count), i915->mm.shrink_memory);Quoted 8 lines
drivers/gpu/drm/i915/i915_debugfs.c static int i915_gem_object_info(struct seq_file *m, void *data) · line 379
Quoted 5 lines
drivers/gpu/drm/i915/i915_debugfs.c +4
-1-seq_putc (m,'\n' ); +if (HAS_LMEM (i915)) { +seq_printf (m,"LMEM total: %llu bytes, available %llu bytes\n" , + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->total, + (u64 )i915->mm.regions[INTEL_REGION_LMEM ]->avail);%pa for
resource_size_t
Quoted 2 lines
with
READ_ONCE(i915->mm.regions[INTEL_REGION_LMEM]->total)%pa is not going well. Getting -Werror=format=. %llu is compiling without any warnings.
Did you remove the (u64)?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx