gpu: nvgpu: Use vzalloc for bitmap

Allocator bitmap is now larger, and cannot be allocated with kzalloc
anymore.

Bug 200081843

Change-Id: I9c978ddbdd796e4f1dd5719dbef3a6bd99e64f48
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/709884
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
This commit is contained in:
Terje Bergstrom
2015-02-20 10:29:55 -08:00
committed by Dan Willemsen
parent ccfea85b47
commit 0312497ee8

View File

@@ -17,6 +17,7 @@
*/
#include "gk20a_allocator.h"
#include <linux/vmalloc.h>
/* init allocator struct */
int gk20a_allocator_init(struct gk20a_allocator *allocator,
@@ -29,8 +30,7 @@ int gk20a_allocator_init(struct gk20a_allocator *allocator,
allocator->base = start;
allocator->limit = start + len - 1;
allocator->bitmap = kzalloc(BITS_TO_LONGS(len) * sizeof(long),
GFP_KERNEL);
allocator->bitmap = vzalloc(BITS_TO_LONGS(len) * sizeof(long));
if (!allocator->bitmap)
return -ENOMEM;
@@ -50,7 +50,7 @@ void gk20a_allocator_destroy(struct gk20a_allocator *allocator)
{
down_write(&allocator->rw_sema);
kfree(allocator->bitmap);
vfree(allocator->bitmap);
memset(allocator, 0, sizeof(struct gk20a_allocator));
}