diff options
author | Deepak Bhosale <dbhosale@nvidia.com> | 2018-03-30 14:35:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-04-27 14:33:27 -0400 |
commit | 43bbd777c5b259ad8df43dbe4c9e95277ec149b1 (patch) | |
tree | 3cb6f3b6c98573836ed97e2c43a76353330bfe50 /drivers/gpu/nvgpu | |
parent | 9ed117dd01d60d540d430aebcd286e7bacf84930 (diff) |
gpu: nvgpu: fix per-GPU DMA allocation tracking
- total DMA memory allocation is currently tracked by adding page aligned
size of nvgpu_mem
- The sequence is roughly as follows:
- total dma memory used += mem->aligned_size
- mem->aligned_size = PAGE_ALIGN(size)
- In above sequence, nvgpu_mem structure is initially zero when it is added
to total dma memory used after which it is assigned page aligned value
- This patch fixes total dma memory usage tracking.
Change-Id: Ibb879c8d38ae9077c3d198d9bb008a72e9208b4d
Signed-off-by: Deepak Bhosale <dbhosale@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1685312
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/dma.c b/drivers/gpu/nvgpu/common/linux/dma.c index 53e54bc6..f513dcd6 100644 --- a/drivers/gpu/nvgpu/common/linux/dma.c +++ b/drivers/gpu/nvgpu/common/linux/dma.c | |||
@@ -240,7 +240,7 @@ int nvgpu_dma_alloc_flags_sys(struct gk20a *g, unsigned long flags, | |||
240 | * Before the debug print so we see this in the total. But during | 240 | * Before the debug print so we see this in the total. But during |
241 | * cleanup in the fail path this has to be subtracted. | 241 | * cleanup in the fail path this has to be subtracted. |
242 | */ | 242 | */ |
243 | g->dma_memory_used += mem->aligned_size; | 243 | g->dma_memory_used += PAGE_ALIGN(size); |
244 | 244 | ||
245 | dma_dbg_alloc(g, size, flags, "sysmem"); | 245 | dma_dbg_alloc(g, size, flags, "sysmem"); |
246 | 246 | ||