@@ -256,6 +256,7 @@ extern long vread(char *buf, char *addr, unsigned long count);
extern struct list_head vmap_area_list;
extern __init void vm_area_add_early(struct vm_struct *vm);
extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
+extern bool get_vmap_allow_huge(void);
#ifdef CONFIG_SMP
# ifdef CONFIG_MMU
@@ -72,6 +72,11 @@ early_param("nohugevmalloc", set_nohugevmalloc);
static const bool vmap_allow_huge = false;
#endif /* CONFIG_HAVE_ARCH_HUGE_VMALLOC */
+bool get_vmap_allow_huge(void)
+{
+ return vmap_allow_huge;
+}
+
bool is_vmalloc_addr(const void *x)
{
unsigned long addr = (unsigned long)x;
Users can use get_vmap_allow_huge() to predict the behavior of vmalloc (or its variations). Specifically, if get_vmap_allow_huge() == false, vmalloc will never return huge pages. Signed-off-by: Song Liu <song@kernel.org> --- include/linux/vmalloc.h | 1 + mm/vmalloc.c | 5 +++++ 2 files changed, 6 insertions(+)