diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ae007462b7f6..6b8889da69a6 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <asm/tlbflush.h> | 31 | #include <asm/tlbflush.h> |
32 | #include <asm/shmparam.h> | 32 | #include <asm/shmparam.h> |
33 | 33 | ||
34 | bool vmap_lazy_unmap __read_mostly = true; | ||
34 | 35 | ||
35 | /*** Page table manipulation functions ***/ | 36 | /*** Page table manipulation functions ***/ |
36 | 37 | ||
@@ -502,6 +503,9 @@ static unsigned long lazy_max_pages(void) | |||
502 | { | 503 | { |
503 | unsigned int log; | 504 | unsigned int log; |
504 | 505 | ||
506 | if (!vmap_lazy_unmap) | ||
507 | return 0; | ||
508 | |||
505 | log = fls(num_online_cpus()); | 509 | log = fls(num_online_cpus()); |
506 | 510 | ||
507 | return log * (32UL * 1024 * 1024 / PAGE_SIZE); | 511 | return log * (32UL * 1024 * 1024 / PAGE_SIZE); |
@@ -732,7 +736,7 @@ static struct vmap_block *new_vmap_block(gfp_t gfp_mask) | |||
732 | node, gfp_mask); | 736 | node, gfp_mask); |
733 | if (unlikely(IS_ERR(va))) { | 737 | if (unlikely(IS_ERR(va))) { |
734 | kfree(vb); | 738 | kfree(vb); |
735 | return ERR_PTR(PTR_ERR(va)); | 739 | return ERR_CAST(va); |
736 | } | 740 | } |
737 | 741 | ||
738 | err = radix_tree_preload(gfp_mask); | 742 | err = radix_tree_preload(gfp_mask); |
@@ -2403,7 +2407,7 @@ static int s_show(struct seq_file *m, void *p) | |||
2403 | seq_printf(m, " pages=%d", v->nr_pages); | 2407 | seq_printf(m, " pages=%d", v->nr_pages); |
2404 | 2408 | ||
2405 | if (v->phys_addr) | 2409 | if (v->phys_addr) |
2406 | seq_printf(m, " phys=%lx", v->phys_addr); | 2410 | seq_printf(m, " phys=%llx", (unsigned long long)v->phys_addr); |
2407 | 2411 | ||
2408 | if (v->flags & VM_IOREMAP) | 2412 | if (v->flags & VM_IOREMAP) |
2409 | seq_printf(m, " ioremap"); | 2413 | seq_printf(m, " ioremap"); |
@@ -2437,8 +2441,11 @@ static int vmalloc_open(struct inode *inode, struct file *file) | |||
2437 | unsigned int *ptr = NULL; | 2441 | unsigned int *ptr = NULL; |
2438 | int ret; | 2442 | int ret; |
2439 | 2443 | ||
2440 | if (NUMA_BUILD) | 2444 | if (NUMA_BUILD) { |
2441 | ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL); | 2445 | ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL); |
2446 | if (ptr == NULL) | ||
2447 | return -ENOMEM; | ||
2448 | } | ||
2442 | ret = seq_open(file, &vmalloc_op); | 2449 | ret = seq_open(file, &vmalloc_op); |
2443 | if (!ret) { | 2450 | if (!ret) { |
2444 | struct seq_file *m = file->private_data; | 2451 | struct seq_file *m = file->private_data; |