diff options
-rw-r--r-- | include/linux/vmalloc.h | 2 | ||||
-rw-r--r-- | mm/vmalloc.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 227c2a585e4f..b840fdaf438c 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
9 | 9 | ||
10 | extern bool vmap_lazy_unmap; | ||
11 | |||
10 | /* bits in flags of vmalloc's vm_struct below */ | 12 | /* bits in flags of vmalloc's vm_struct below */ |
11 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
12 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ae007462b7f6..7f35fe2cf9e7 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); |