diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-03-26 18:28:51 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-07-27 11:49:09 -0400 |
commit | a0d40c80256e31b23849f2ba781b74bf0218a1fa (patch) | |
tree | f89ad006e486c021d95db3f37763558556d731e1 /mm/vmalloc.c | |
parent | 08bbc9da92f7e44b9c208c6a1adba70c403b255e (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>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |