summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-01-11 19:58:14 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-03 13:34:43 -0500
commit3966efc2e58f1802411f44fd00967dde448f278d (patch)
treeb6cf822abc638b79acbd12b749a97ab5507a6fe9 /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
parent76b78b6fdcb0bbed72645aaa85de6013e2b135c3 (diff)
gpu: nvgpu: Give nvgpu_kalloc a less generic name
Change nvgpu_kalloc() to nvgpu_big_[mz]alloc(). This is necessary since the natural free function name for this is nvgpu_kfree() but that conflicts with nvgpu_k[mz]alloc() (implemented in a subsequent patch). This API exists becasue not all allocation sizes can be determined at compile time and in some cases sizes may vary across the system page size. Thus always using kmalloc() could lead to OOM errors due to fragmentation. But always using vmalloc() is wastful of memory for small allocations. This API tries to alleviate those problems. Bug 1799159 Bug 1823380 Change-Id: I49ec5292ce13bcdecf112afbb4a0cfffeeb5ecfc Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1283827 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index f6290e1d..4a42e03f 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -24,6 +24,8 @@
24#include <linux/dma-buf.h> 24#include <linux/dma-buf.h>
25#include <uapi/linux/nvgpu.h> 25#include <uapi/linux/nvgpu.h>
26 26
27#include <nvgpu/kmem.h>
28
27#include "gk20a.h" 29#include "gk20a.h"
28#include "gr_gk20a.h" 30#include "gr_gk20a.h"
29#include "dbg_gpu_gk20a.h" 31#include "dbg_gpu_gk20a.h"
@@ -817,7 +819,7 @@ static int nvgpu_dbg_gpu_ioctl_access_fb_memory(struct dbg_session_gk20a *dbg_s,
817 goto fail_dmabuf_put; 819 goto fail_dmabuf_put;
818 } 820 }
819 821
820 buffer = nvgpu_kalloc(access_limit_size, true); 822 buffer = nvgpu_big_zalloc(access_limit_size);
821 if (!buffer) { 823 if (!buffer) {
822 err = -ENOMEM; 824 err = -ENOMEM;
823 goto fail_dmabuf_put; 825 goto fail_dmabuf_put;
@@ -863,7 +865,7 @@ static int nvgpu_dbg_gpu_ioctl_access_fb_memory(struct dbg_session_gk20a *dbg_s,
863fail_idle: 865fail_idle:
864 gk20a_idle(g->dev); 866 gk20a_idle(g->dev);
865fail_free_buffer: 867fail_free_buffer:
866 nvgpu_kfree(buffer); 868 nvgpu_big_free(buffer);
867fail_dmabuf_put: 869fail_dmabuf_put:
868 dma_buf_put(dmabuf); 870 dma_buf_put(dmabuf);
869 871