Commit a0d40c80 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Konrad Rzeszutek Wilk
Browse files

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: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: default avatarNick Piggin <npiggin@suse.de>
parent 08bbc9da
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
struct vm_area_struct; /* vma defining user mapping in mm_types.h */ struct vm_area_struct; /* vma defining user mapping in mm_types.h */
extern bool vmap_lazy_unmap;
/* bits in flags of vmalloc's vm_struct below */ /* bits in flags of vmalloc's vm_struct below */
#define VM_IOREMAP 0x00000001 /* ioremap() and friends */ #define VM_IOREMAP 0x00000001 /* ioremap() and friends */
#define VM_ALLOC 0x00000002 /* vmalloc() */ #define VM_ALLOC 0x00000002 /* vmalloc() */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/shmparam.h> #include <asm/shmparam.h>
bool vmap_lazy_unmap __read_mostly = true;
/*** Page table manipulation functions ***/ /*** Page table manipulation functions ***/
...@@ -502,6 +503,9 @@ static unsigned long lazy_max_pages(void) ...@@ -502,6 +503,9 @@ static unsigned long lazy_max_pages(void)
{ {
unsigned int log; unsigned int log;
if (!vmap_lazy_unmap)
return 0;
log = fls(num_online_cpus()); log = fls(num_online_cpus());
return log * (32UL * 1024 * 1024 / PAGE_SIZE); return log * (32UL * 1024 * 1024 / PAGE_SIZE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment