diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 464621d18eb2..5016f19e1661 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -725,9 +725,10 @@ static void free_unmap_vmap_area_addr(unsigned long addr) | |||
725 | #define VMAP_BBMAP_BITS_MIN (VMAP_MAX_ALLOC*2) | 725 | #define VMAP_BBMAP_BITS_MIN (VMAP_MAX_ALLOC*2) |
726 | #define VMAP_MIN(x, y) ((x) < (y) ? (x) : (y)) /* can't use min() */ | 726 | #define VMAP_MIN(x, y) ((x) < (y) ? (x) : (y)) /* can't use min() */ |
727 | #define VMAP_MAX(x, y) ((x) > (y) ? (x) : (y)) /* can't use max() */ | 727 | #define VMAP_MAX(x, y) ((x) > (y) ? (x) : (y)) /* can't use max() */ |
728 | #define VMAP_BBMAP_BITS VMAP_MIN(VMAP_BBMAP_BITS_MAX, \ | 728 | #define VMAP_BBMAP_BITS \ |
729 | VMAP_MAX(VMAP_BBMAP_BITS_MIN, \ | 729 | VMAP_MIN(VMAP_BBMAP_BITS_MAX, \ |
730 | VMALLOC_PAGES / NR_CPUS / 16)) | 730 | VMAP_MAX(VMAP_BBMAP_BITS_MIN, \ |
731 | VMALLOC_PAGES / roundup_pow_of_two(NR_CPUS) / 16)) | ||
731 | 732 | ||
732 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) | 733 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) |
733 | 734 | ||
@@ -2139,6 +2140,14 @@ struct vm_struct *alloc_vm_area(size_t size) | |||
2139 | return NULL; | 2140 | return NULL; |
2140 | } | 2141 | } |
2141 | 2142 | ||
2143 | /* | ||
2144 | * If the allocated address space is passed to a hypercall | ||
2145 | * before being used then we cannot rely on a page fault to | ||
2146 | * trigger an update of the page tables. So sync all the page | ||
2147 | * tables here. | ||
2148 | */ | ||
2149 | vmalloc_sync_all(); | ||
2150 | |||
2142 | return area; | 2151 | return area; |
2143 | } | 2152 | } |
2144 | EXPORT_SYMBOL_GPL(alloc_vm_area); | 2153 | EXPORT_SYMBOL_GPL(alloc_vm_area); |