From 0dc66952e4df80b45c77bdbb31ce2a32f216328f Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 18 May 2015 13:37:54 -0700 Subject: gpu: nvgpu: Use vmalloc only when size >4K When allocation size is 4k or below, we should use kmalloc. vmalloc should be used only for larged allocations. Introduce nvgpu_alloc, which checks the size, and decides the API to use. Change-Id: I593110467cd319851b27e57d1bfe8d228d3f2909 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/743974 (cherry picked from commit 7f56aa1f0ecafbfde7286353b60e25e494674d26) Reviewed-on: http://git-master/r/753276 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 643adca5..c12f196d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -2155,7 +2155,7 @@ static int gk20a_ioctl_channel_submit_gpfifo( * synchronization; we might still wait and do an increment */ size = args->num_entries * sizeof(struct nvgpu_gpfifo); if (size) { - gpfifo = vmalloc(size); + gpfifo = nvgpu_alloc(size, false); if (!gpfifo) return -ENOMEM; @@ -2190,7 +2190,7 @@ static int gk20a_ioctl_channel_submit_gpfifo( gk20a_fence_put(fence_out); clean_up: - vfree(gpfifo); + nvgpu_free(gpfifo); return ret; } -- cgit v1.2.2