diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 8db0c1e9458a34a5b94586ffeba7852fc0a38f17..f49ff8aa920173f303eb4d615456dd11bd85239c 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1751,6 +1751,12 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, if (!addr) return NULL; + /* + * First make sure the mappings are removed from all page-tables + * before they are freed. + */ + vmalloc_sync_all(); + /* * In this function, newly allocated vm_struct has VM_UNINITIALIZED * flag. It means that vm_struct is not fully initialized. @@ -2296,6 +2302,9 @@ EXPORT_SYMBOL(remap_vmalloc_range); /* * Implement a stub for vmalloc_sync_all() if the architecture chose not to * have one. + * + * The purpose of this function is to make sure the vmalloc area + * mappings are identical in all page-tables in the system. */ void __weak vmalloc_sync_all(void) {