The patch titled Subject: lib/genalloc.c: use vzalloc_node() to allocate the bitmap has been added to the -mm tree. Its filename is lib-genallocc-use-the-vzalloc_node-to-allocate-the-bitmap.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/lib-genallocc-use-the-vzalloc_node-to-allocate-the-bitmap.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/lib-genallocc-use-the-vzalloc_node-to-allocate-the-bitmap.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Huang Shijie <sjhuang@xxxxxxxxxxx> Subject: lib/genalloc.c: use vzalloc_node() to allocate the bitmap Some devices may have big memory on chip, such as over 1G. In some cases, the nbytes maybe bigger then 4M which is the bounday of the memory buddy system (4K default). So use vzalloc_node() to allocate the bitmap. Also use vfree to free it. Link: http://lkml.kernel.org/r/20181225015701.6289-1-sjhuang@xxxxxxxxxxx Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Alexey Skidanov <alexey.skidanov@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/lib/genalloc.c~lib-genallocc-use-the-vzalloc_node-to-allocate-the-bitmap +++ a/lib/genalloc.c @@ -187,7 +187,7 @@ int gen_pool_add_virt(struct gen_pool *p 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; @@ -251,7 +251,7 @@ void gen_pool_destroy(struct gen_pool *p bit = find_next_bit(chunk->bits, end_bit, 0); BUG_ON(bit < end_bit); - kfree(chunk); + vfree(chunk); } kfree_const(pool->name); kfree(pool); _ Patches currently in -mm which might be from sjhuang@xxxxxxxxxxx are mm-change-the-order-of-migrate_reclaimable-migrate_movable-in-fallbacks.patch lib-genallocc-use-the-vzalloc_node-to-allocate-the-bitmap.patch lib-genallocc-export-symbol-addr_in_gen_pool.patch