mm/vmalloc.c: increase vm area range in __vmalloc_node

When the CONFIG_ENABLE_VMALLOC_SAVING is enabled, even though
the unused lowmem is used as vmalloc space, but __vmalloc_node()
still uses VMALLOC_START as the start point to allocate vm area,
but the range [VMALLOC_START, VMALLOC_END] is limited, this
may cause vmalloc allocation failure. Change the start point
to allocate the vm area from VMALLOC_START to PAGE_OFFSET to make
that allocation can be chosen from [PAGE_OFFSET, VMALLOC_START)
also.

Change-Id: I89c099484846c4bcd9b607c1925f253c165d0dd9
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
This commit is contained in:
Qingqing Zhou 2020-01-03 20:08:43 +08:00 • committed by Gerrit - the friendly Code Review server
commit b588978a22

View file

@ -2631,8 +2631,13 @@ static void *__vmalloc_node(unsigned long size, unsigned long align,
gfp_t gfp_mask, pgprot_t prot,
int node, const void *caller)
{
#ifdef CONFIG_ENABLE_VMALLOC_SAVING
return __vmalloc_node_range(size, align, PAGE_OFFSET, VMALLOC_END,
gfp_mask, prot, 0, node, caller);
#else
return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
gfp_mask, prot, 0, node, caller);
#endif
}
void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)