diff mbox series

[RFC,v2,1/3] vmalloc: export __vmalloc_node_range for CONFIG_TEST_VMALLOC_MODULE

Message ID 20181231132640.21898-2-urezki@gmail.com (mailing list archive)
State New, archived
Headers show
Series test driver to analyse vmalloc allocator | expand

Commit Message

Uladzislau Rezki Dec. 31, 2018, 1:26 p.m. UTC
Export __vmaloc_node_range() function if CONFIG_TEST_VMALLOC_MODULE is
enabled. Some test cases in vmalloc test suite module require and make
use of that function. Please note, that it is not supposed to be used
for other purposes.

We need it only for performance analysis, stressing and stability check
of vmalloc allocator.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 mm/vmalloc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Matthew Wilcox Dec. 31, 2018, 6:50 p.m. UTC | #1
On Mon, Dec 31, 2018 at 02:26:38PM +0100, Uladzislau Rezki (Sony) wrote:
> +#ifdef CONFIG_TEST_VMALLOC_MODULE
> +EXPORT_SYMBOL(__vmalloc_node_range);
> +#endif

Definitely needs to be _GPL.
Uladzislau Rezki Jan. 1, 2019, 4:55 p.m. UTC | #2
On Mon, Dec 31, 2018 at 10:50:22AM -0800, Matthew Wilcox wrote:
> On Mon, Dec 31, 2018 at 02:26:38PM +0100, Uladzislau Rezki (Sony) wrote:
> > +#ifdef CONFIG_TEST_VMALLOC_MODULE
> > +EXPORT_SYMBOL(__vmalloc_node_range);
> > +#endif
> 
> Definitely needs to be _GPL.
Will upload updated variant. 

Thanks for the comment!

--
Vlad Rezki
diff mbox series

Patch

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index cfea25be7754..50ccb8bdfad8 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1764,6 +1764,15 @@  void *__vmalloc_node_range(unsigned long size, unsigned long align,
 	return NULL;
 }
 
+/*
+ * This is only for performance analysis of vmalloc and stress purpose.
+ * It is required by vmalloc test module, therefore do not use it other
+ * than that.
+ */
+#ifdef CONFIG_TEST_VMALLOC_MODULE
+EXPORT_SYMBOL(__vmalloc_node_range);
+#endif
+
 /**
  *	__vmalloc_node  -  allocate virtually contiguous memory
  *	@size:		allocation size