linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lib/genalloc.c: Use the vzalloc_node to allocate the bitmap.
@ 2018-12-24  7:06 Huang Shijie
  2018-12-24  7:06 ` [PATCH 2/2] lib/genalloc.c: export symbol addr_in_gen_pool Huang Shijie
  2018-12-25  1:57 ` [PATCH 1/2 fix] lib/genalloc.c: Use the vzalloc_node to allocate the bitmap Huang Shijie
  0 siblings, 2 replies; 8+ messages in thread
From: Huang Shijie @ 2018-12-24  7:06 UTC (permalink / raw)
  To: akpm; +Cc: sfr, alexey.skidanov, linux-kernel, shijie8, Huang Shijie

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-03 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-24  7:06 [PATCH 1/2] lib/genalloc.c: Use the vzalloc_node to allocate the bitmap Huang Shijie
2018-12-24  7:06 ` [PATCH 2/2] lib/genalloc.c: export symbol addr_in_gen_pool Huang Shijie
2018-12-28  5:49   ` Andrew Morton
2018-12-28  7:45     ` Huang Shijie
2019-01-03  7:55   ` Christoph Hellwig
2019-01-03 10:11     ` Huang Shijie
2019-01-03 15:37       ` Christoph Hellwig
2018-12-25  1:57 ` [PATCH 1/2 fix] lib/genalloc.c: Use the vzalloc_node to allocate the bitmap Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).