[PATCH 1/6] mm: Add vmalloc_huge_node()

Peter Zijlstra posted 6 patches 1 month ago
[PATCH 1/6] mm: Add vmalloc_huge_node()
Posted by Peter Zijlstra 1 month ago
To enable node specific hash-tables.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/vmalloc.h |    3 +++
 mm/vmalloc.c            |    7 +++++++
 2 files changed, 10 insertions(+)

--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -177,6 +177,9 @@ void *__vmalloc_node_noprof(unsigned lon
 void *vmalloc_huge_noprof(unsigned long size, gfp_t gfp_mask) __alloc_size(1);
 #define vmalloc_huge(...)	alloc_hooks(vmalloc_huge_noprof(__VA_ARGS__))
 
+void *vmalloc_huge_node_noprof(unsigned long size, gfp_t gfp_mask, int node) __alloc_size(1);
+#define vmalloc_huge_node(...)	alloc_hooks(vmalloc_huge_node_noprof(__VA_ARGS__))
+
 extern void *__vmalloc_array_noprof(size_t n, size_t size, gfp_t flags) __alloc_size(1, 2);
 #define __vmalloc_array(...)	alloc_hooks(__vmalloc_array_noprof(__VA_ARGS__))
 
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3948,6 +3948,13 @@ void *vmalloc_huge_noprof(unsigned long
 }
 EXPORT_SYMBOL_GPL(vmalloc_huge_noprof);
 
+void *vmalloc_huge_node_noprof(unsigned long size, gfp_t gfp_mask, int node)
+{
+	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
+				    gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP,
+				    node, __builtin_return_address(0));
+}
+
 /**
  * vzalloc - allocate virtually contiguous memory with zero fill
  * @size:    allocation size
Re: [PATCH 1/6] mm: Add vmalloc_huge_node()
Posted by Christoph Lameter (Ampere) 1 month ago
On Fri, 25 Oct 2024, Peter Zijlstra wrote:

> To enable node specific hash-tables.

Reviewed-by: Christoph Lameter <cl@linux.com>
Re: [PATCH 1/6] mm: Add vmalloc_huge_node()
Posted by Davidlohr Bueso 1 month ago
On Fri, 25 Oct 2024, Peter Zijlstra wrote:

>To enable node specific hash-tables.
>
>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>Reviewed-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Re: [PATCH 1/6] mm: Add vmalloc_huge_node()
Posted by Uladzislau Rezki 1 month ago
On Fri, Oct 25, 2024 at 11:03:48AM +0200, Peter Zijlstra wrote:
> To enable node specific hash-tables.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
>  include/linux/vmalloc.h |    3 +++
>  mm/vmalloc.c            |    7 +++++++
>  2 files changed, 10 insertions(+)
> 
> --- a/include/linux/vmalloc.h
> +++ b/include/linux/vmalloc.h
> @@ -177,6 +177,9 @@ void *__vmalloc_node_noprof(unsigned lon
>  void *vmalloc_huge_noprof(unsigned long size, gfp_t gfp_mask) __alloc_size(1);
>  #define vmalloc_huge(...)	alloc_hooks(vmalloc_huge_noprof(__VA_ARGS__))
>  
> +void *vmalloc_huge_node_noprof(unsigned long size, gfp_t gfp_mask, int node) __alloc_size(1);
> +#define vmalloc_huge_node(...)	alloc_hooks(vmalloc_huge_node_noprof(__VA_ARGS__))
> +
>  extern void *__vmalloc_array_noprof(size_t n, size_t size, gfp_t flags) __alloc_size(1, 2);
>  #define __vmalloc_array(...)	alloc_hooks(__vmalloc_array_noprof(__VA_ARGS__))
>  
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -3948,6 +3948,13 @@ void *vmalloc_huge_noprof(unsigned long
>  }
>  EXPORT_SYMBOL_GPL(vmalloc_huge_noprof);
>  
> +void *vmalloc_huge_node_noprof(unsigned long size, gfp_t gfp_mask, int node)
> +{
> +	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
> +				    gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP,
> +				    node, __builtin_return_address(0));
> +}
> +
>  /**
>   * vzalloc - allocate virtually contiguous memory with zero fill
>   * @size:    allocation size
> 
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Uladzislau Rezki