diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-01-11 18:00:54 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-03 13:34:48 -0500 |
commit | 707ea45e0f1d7a07885597777496b186dd5fb6f0 (patch) | |
tree | 9b48640703ccdf0108d731e66574370179a44b23 /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 3966efc2e58f1802411f44fd00967dde448f278d (diff) |
gpu: nvgpu: kmem abstraction and tracking
Implement kmem abstraction and tracking in nvgpu. The abstraction
helps move nvgpu's core code away from being Linux dependent and
allows kmem allocation tracking to be done for Linux and any other
OS supported by nvgpu.
Bug 1799159
Bug 1823380
Change-Id: Ieaae4ca1bbd1d4db4a1546616ab8b9fc53a4079d
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1283828
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8006a4fe..69528c1f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -27,6 +27,7 @@ struct gk20a_ctxsw_ucode_segments; | |||
27 | struct gk20a_fecs_trace; | 27 | struct gk20a_fecs_trace; |
28 | struct gk20a_ctxsw_trace; | 28 | struct gk20a_ctxsw_trace; |
29 | struct acr_desc; | 29 | struct acr_desc; |
30 | struct nvgpu_mem_alloc_tracker; | ||
30 | 31 | ||
31 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
32 | #include <nvgpu/lock.h> | 33 | #include <nvgpu/lock.h> |
@@ -915,6 +916,7 @@ struct gk20a { | |||
915 | struct dentry *debugfs_runlist_interleave; | 916 | struct dentry *debugfs_runlist_interleave; |
916 | struct dentry *debugfs_allocators; | 917 | struct dentry *debugfs_allocators; |
917 | struct dentry *debugfs_xve; | 918 | struct dentry *debugfs_xve; |
919 | struct dentry *debugfs_kmem; | ||
918 | #endif | 920 | #endif |
919 | struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; | 921 | struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; |
920 | 922 | ||
@@ -1055,6 +1057,10 @@ struct gk20a { | |||
1055 | /* Check if msi is enabled */ | 1057 | /* Check if msi is enabled */ |
1056 | bool msi_enabled; | 1058 | bool msi_enabled; |
1057 | #endif | 1059 | #endif |
1060 | #ifdef CONFIG_NVGPU_TRACK_MEM_USAGE | ||
1061 | struct nvgpu_mem_alloc_tracker *vmallocs; | ||
1062 | struct nvgpu_mem_alloc_tracker *kmallocs; | ||
1063 | #endif | ||
1058 | }; | 1064 | }; |
1059 | 1065 | ||
1060 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) | 1066 | static inline unsigned long gk20a_get_gr_idle_timeout(struct gk20a *g) |
@@ -1131,6 +1137,7 @@ enum gk20a_dbg_categories { | |||
1131 | gpu_dbg_pmu_pstate = BIT(17), /* p state controlled by pmu */ | 1137 | gpu_dbg_pmu_pstate = BIT(17), /* p state controlled by pmu */ |
1132 | gpu_dbg_xv = BIT(18), /* XVE debugging */ | 1138 | gpu_dbg_xv = BIT(18), /* XVE debugging */ |
1133 | gpu_dbg_shutdown = BIT(19), /* GPU shutdown tracing */ | 1139 | gpu_dbg_shutdown = BIT(19), /* GPU shutdown tracing */ |
1140 | gpu_dbg_kmem = BIT(20), /* Kmem tracking debugging */ | ||
1134 | gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */ | 1141 | gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */ |
1135 | }; | 1142 | }; |
1136 | 1143 | ||