Skip to content

Commit

Permalink
enabled memory allocation above 32GB
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Sharma Mailthody committed Jan 9, 2022
1 parent cba22f8 commit 877025b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static struct map* create_descriptor(const struct ctrl* ctrl, u64 vaddr, unsigne
unsigned long i;
struct map* map = NULL;

map = kmalloc(sizeof(struct map) + (n_pages - 1) * sizeof(uint64_t), GFP_KERNEL);
map = kvmalloc(sizeof(struct map) + (n_pages - 1) * sizeof(uint64_t), GFP_KERNEL);
if (map == NULL)
{
printk(KERN_CRIT "Failed to allocate mapping descriptor\n");
Expand Down Expand Up @@ -71,7 +71,7 @@ void unmap_and_release(struct map* map)
map->release(map);
}

kfree(map);
kvfree(map);
}


Expand Down Expand Up @@ -119,7 +119,7 @@ static void release_user_pages(struct map* map)
put_page(pages[i]);
}

kfree(map->data);
kvfree(map->data);
map->data = NULL;

//printk(KERN_DEBUG "Released %lu host pages\n", map->n_addrs);
Expand All @@ -134,7 +134,7 @@ static long map_user_pages(struct map* map)
struct page** pages;
struct device* dev;

pages = (struct page**) kcalloc(map->n_addrs, sizeof(struct page*), GFP_KERNEL);
pages = (struct page**) kvcalloc(map->n_addrs, sizeof(struct page*), GFP_KERNEL);
if (pages == NULL)
{
printk(KERN_CRIT "Failed to allocate page array\n");
Expand Down

0 comments on commit 877025b

Please sign in to comment.