Skip to content

Commit 3722e13

Browse files
Wanpeng Litorvalds
authored andcommitted
mm/vmalloc: don't set area->caller twice
The caller address has already been set in set_vmalloc_vm(), there's no need to set it again in __vmalloc_area_node. Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 948927e commit 3722e13

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mm/vmalloc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static void *__vmalloc_node(unsigned long size, unsigned long align,
15461546
gfp_t gfp_mask, pgprot_t prot,
15471547
int node, const void *caller);
15481548
static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
1549-
pgprot_t prot, int node, const void *caller)
1549+
pgprot_t prot, int node)
15501550
{
15511551
const int order = 0;
15521552
struct page **pages;
@@ -1560,13 +1560,12 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
15601560
/* Please note that the recursion is strictly bounded. */
15611561
if (array_size > PAGE_SIZE) {
15621562
pages = __vmalloc_node(array_size, 1, nested_gfp|__GFP_HIGHMEM,
1563-
PAGE_KERNEL, node, caller);
1563+
PAGE_KERNEL, node, area->caller);
15641564
area->flags |= VM_VPAGES;
15651565
} else {
15661566
pages = kmalloc_node(array_size, nested_gfp, node);
15671567
}
15681568
area->pages = pages;
1569-
area->caller = caller;
15701569
if (!area->pages) {
15711570
remove_vm_area(area->addr);
15721571
kfree(area);
@@ -1634,7 +1633,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
16341633
if (!area)
16351634
goto fail;
16361635

1637-
addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller);
1636+
addr = __vmalloc_area_node(area, gfp_mask, prot, node);
16381637
if (!addr)
16391638
goto fail;
16401639

0 commit comments

Comments
 (0)