aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2010-03-26 18:28:51 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2010-07-27 11:49:09 -0400
commita0d40c80256e31b23849f2ba781b74bf0218a1fa (patch)
treef89ad006e486c021d95db3f37763558556d731e1
parent08bbc9da92f7e44b9c208c6a1adba70c403b255e (diff)
vmap: add flag to allow lazy unmap to be disabled at runtime
Add a flag to force lazy_max_pages() to zero to prevent any outstanding mapped pages. We'll need this for Xen. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Nick Piggin <npiggin@suse.de>
-rw-r--r--include/linux/vmalloc.h2
-rw-r--r--mm/vmalloc.c4
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
8struct vm_area_struct; /* vma defining user mapping in mm_types.h */ 8struct vm_area_struct; /* vma defining user mapping in mm_types.h */
9 9
10extern 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
34bool 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);