diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/debug_allocator.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 15 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/allocator.h | 14 |
3 files changed, 1 insertions, 33 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_allocator.c b/drivers/gpu/nvgpu/common/linux/debug_allocator.c index 6a0aa4c5..766c8486 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_allocator.c +++ b/drivers/gpu/nvgpu/common/linux/debug_allocator.c | |||
@@ -20,8 +20,6 @@ | |||
20 | 20 | ||
21 | #include <nvgpu/allocator.h> | 21 | #include <nvgpu/allocator.h> |
22 | 22 | ||
23 | u32 nvgpu_alloc_tracing_on; | ||
24 | |||
25 | void nvgpu_alloc_print_stats(struct nvgpu_allocator *__a, | 23 | void nvgpu_alloc_print_stats(struct nvgpu_allocator *__a, |
26 | struct seq_file *s, int lock) | 24 | struct seq_file *s, int lock) |
27 | { | 25 | { |
@@ -76,7 +74,4 @@ void nvgpu_alloc_debugfs_init(struct gk20a *g) | |||
76 | l->debugfs_allocators = NULL; | 74 | l->debugfs_allocators = NULL; |
77 | return; | 75 | return; |
78 | } | 76 | } |
79 | |||
80 | debugfs_create_u32("tracing", 0664, l->debugfs_allocators, | ||
81 | &nvgpu_alloc_tracing_on); | ||
82 | } | 77 | } |
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index 3e305bb8..a2e6c44a 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c | |||
@@ -785,8 +785,6 @@ static u64 nvgpu_buddy_balloc(struct nvgpu_allocator *__a, u64 len) | |||
785 | int pte_size; | 785 | int pte_size; |
786 | struct nvgpu_buddy_allocator *a = __a->priv; | 786 | struct nvgpu_buddy_allocator *a = __a->priv; |
787 | 787 | ||
788 | nvgpu_alloc_trace_func(); | ||
789 | |||
790 | alloc_lock(__a); | 788 | alloc_lock(__a); |
791 | 789 | ||
792 | order = balloc_get_order(a, len); | 790 | order = balloc_get_order(a, len); |
@@ -794,7 +792,6 @@ static u64 nvgpu_buddy_balloc(struct nvgpu_allocator *__a, u64 len) | |||
794 | if (order > a->max_order) { | 792 | if (order > a->max_order) { |
795 | alloc_unlock(__a); | 793 | alloc_unlock(__a); |
796 | alloc_dbg(balloc_owner(a), "Alloc fail\n"); | 794 | alloc_dbg(balloc_owner(a), "Alloc fail\n"); |
797 | nvgpu_alloc_trace_func_done(); | ||
798 | return 0; | 795 | return 0; |
799 | } | 796 | } |
800 | 797 | ||
@@ -822,7 +819,6 @@ static u64 nvgpu_buddy_balloc(struct nvgpu_allocator *__a, u64 len) | |||
822 | 819 | ||
823 | alloc_unlock(__a); | 820 | alloc_unlock(__a); |
824 | 821 | ||
825 | nvgpu_alloc_trace_func_done(); | ||
826 | return addr; | 822 | return addr; |
827 | } | 823 | } |
828 | 824 | ||
@@ -838,8 +834,6 @@ static u64 __nvgpu_balloc_fixed_buddy(struct nvgpu_allocator *__a, | |||
838 | struct nvgpu_fixed_alloc *falloc = NULL; | 834 | struct nvgpu_fixed_alloc *falloc = NULL; |
839 | struct nvgpu_buddy_allocator *a = __a->priv; | 835 | struct nvgpu_buddy_allocator *a = __a->priv; |
840 | 836 | ||
841 | nvgpu_alloc_trace_func(); | ||
842 | |||
843 | /* If base isn't aligned to an order 0 block, fail. */ | 837 | /* If base isn't aligned to an order 0 block, fail. */ |
844 | if (base & (a->blk_size - 1)) | 838 | if (base & (a->blk_size - 1)) |
845 | goto fail; | 839 | goto fail; |
@@ -890,14 +884,12 @@ static u64 __nvgpu_balloc_fixed_buddy(struct nvgpu_allocator *__a, | |||
890 | 884 | ||
891 | alloc_dbg(balloc_owner(a), "Alloc (fixed) 0x%llx\n", base); | 885 | alloc_dbg(balloc_owner(a), "Alloc (fixed) 0x%llx\n", base); |
892 | 886 | ||
893 | nvgpu_alloc_trace_func_done(); | ||
894 | return base; | 887 | return base; |
895 | 888 | ||
896 | fail_unlock: | 889 | fail_unlock: |
897 | alloc_unlock(__a); | 890 | alloc_unlock(__a); |
898 | fail: | 891 | fail: |
899 | nvgpu_kfree(nvgpu_alloc_to_gpu(__a), falloc); | 892 | nvgpu_kfree(nvgpu_alloc_to_gpu(__a), falloc); |
900 | nvgpu_alloc_trace_func_done(); | ||
901 | return 0; | 893 | return 0; |
902 | } | 894 | } |
903 | 895 | ||
@@ -932,12 +924,8 @@ static void nvgpu_buddy_bfree(struct nvgpu_allocator *__a, u64 addr) | |||
932 | struct nvgpu_fixed_alloc *falloc; | 924 | struct nvgpu_fixed_alloc *falloc; |
933 | struct nvgpu_buddy_allocator *a = __a->priv; | 925 | struct nvgpu_buddy_allocator *a = __a->priv; |
934 | 926 | ||
935 | nvgpu_alloc_trace_func(); | 927 | if (!addr) |
936 | |||
937 | if (!addr) { | ||
938 | nvgpu_alloc_trace_func_done(); | ||
939 | return; | 928 | return; |
940 | } | ||
941 | 929 | ||
942 | alloc_lock(__a); | 930 | alloc_lock(__a); |
943 | 931 | ||
@@ -966,7 +954,6 @@ static void nvgpu_buddy_bfree(struct nvgpu_allocator *__a, u64 addr) | |||
966 | done: | 954 | done: |
967 | alloc_unlock(__a); | 955 | alloc_unlock(__a); |
968 | alloc_dbg(balloc_owner(a), "Free 0x%llx\n", addr); | 956 | alloc_dbg(balloc_owner(a), "Free 0x%llx\n", addr); |
969 | nvgpu_alloc_trace_func_done(); | ||
970 | return; | 957 | return; |
971 | } | 958 | } |
972 | 959 | ||
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 567c4422..30bfa750 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h | |||
@@ -281,20 +281,6 @@ static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a) | |||
281 | /* | 281 | /* |
282 | * Debug stuff. | 282 | * Debug stuff. |
283 | */ | 283 | */ |
284 | extern u32 nvgpu_alloc_tracing_on; | ||
285 | |||
286 | #define nvgpu_alloc_trace_func() \ | ||
287 | do { \ | ||
288 | if (nvgpu_alloc_tracing_on) \ | ||
289 | trace_printk("%s\n", __func__); \ | ||
290 | } while (0) | ||
291 | |||
292 | #define nvgpu_alloc_trace_func_done() \ | ||
293 | do { \ | ||
294 | if (nvgpu_alloc_tracing_on) \ | ||
295 | trace_printk("%s_done\n", __func__); \ | ||
296 | } while (0) | ||
297 | |||
298 | #define __alloc_pstat(seq, allocator, fmt, arg...) \ | 284 | #define __alloc_pstat(seq, allocator, fmt, arg...) \ |
299 | do { \ | 285 | do { \ |
300 | if (s) \ | 286 | if (s) \ |