mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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:
committed by
Dan Willemsen
parent
ccfea85b47
commit
0312497ee8
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user