From 8662fae334f2419da2e7fd220f7734217ec52433 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 22 Aug 2017 17:41:24 -0700 Subject: gpu: nvgpu: Add mem usage to page allocator debug Add the amount of memory used to the page allocator debug dump. Change-Id: Icd4b4a0489068aaa3f60221b792de7f8dbf0092c Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1543695 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Konsta Holtta Reviewed-by: svccoveritychecker Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/common/mm/page_allocator.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/gpu/nvgpu/common') diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c index 3f4f3706..0eda13ec 100644 --- a/drivers/gpu/nvgpu/common/mm/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c @@ -777,6 +777,16 @@ static void nvgpu_page_print_stats(struct nvgpu_allocator *__a, __alloc_pstat(s, __a, " pages freed %lld\n", a->pages_freed); __alloc_pstat(s, __a, "\n"); + __alloc_pstat(s, __a, "Page size: %lld KB\n", + a->page_size >> 10); + __alloc_pstat(s, __a, "Total pages: %lld (%lld MB)\n", + a->length / a->page_size, + a->length >> 20); + __alloc_pstat(s, __a, "Available pages: %lld (%lld MB)\n", + nvgpu_alloc_space(&a->source_allocator) / a->page_size, + nvgpu_alloc_space(&a->source_allocator) >> 20); + __alloc_pstat(s, __a, "\n"); + /* * Slab info. */ -- cgit v1.2.2