lkml.org 
[lkml]   [2018]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] lib/genalloc.c: Use the vzalloc_node to allocate the bitmap.
Date
Some devices may have over 1G memory on chip.
In some cases, the nbytes may big then 4M which is the bounday of
the memory buddy system. So use vzalloc_node() to allocate the bitmap.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
lib/genalloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/genalloc.c b/lib/genalloc.c
index 5deb25c40a5a..0d0ff9f0483f 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -187,7 +187,7 @@ int gen_pool_add_virt(struct gen_pool *pool, unsigned long virt, phys_addr_t phy
int nbytes = sizeof(struct gen_pool_chunk) +
BITS_TO_LONGS(nbits) * sizeof(long);

- chunk = kzalloc_node(nbytes, GFP_KERNEL, nid);
+ chunk = vzalloc_node(nbytes, nid);
if (unlikely(chunk == NULL))
return -ENOMEM;

--
2.17.1
\
 
 \ /
  Last update: 2018-12-24 08:23    [W:0.089 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site