diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 0549ca17ba6f..12c55bbec8c0 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -245,4 +245,8 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) int register_vmap_purge_notifier(struct notifier_block *nb); int unregister_vmap_purge_notifier(struct notifier_block *nb); +#ifndef arch_disable_lazy_vunmap +#define arch_disable_lazy_vunmap false +#endif + #endif /* _LINUX_VMALLOC_H */ diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 817a472ee30f..50d49ca35885 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1297,6 +1297,9 @@ static unsigned long lazy_max_pages(void) { unsigned int log; + if (arch_disable_lazy_vunmap) + return 0; + log = fls(num_online_cpus()); return log * (32UL * 1024 * 1024 / PAGE_SIZE);