Re: [RFC][PATCH 05/10] mm: Add vmalloc_huge_node()

From
Peter Zijlstra <peterz@infradead.org>
Date
2023-07-14 15:10:10
Also in
linux-arch, linux-mm, lkml
Reply to
Matthew Wilcox, 2023-07-14
On Fri, Jul 14, 2023 at 03:37:38PM +0100, Matthew Wilcox wrote:
On Fri, Jul 14, 2023 at 03:39:04PM +0200, Peter Zijlstra wrote:
quoted
+void *vmalloc_huge_node(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));
+}
+
 /**
  * vmalloc_huge - allocate virtually contiguous memory, allow huge pages
  * @size:      allocation size
@@ -3430,9 +3437,7 @@ EXPORT_SYMBOL(vmalloc);
  */
 void *vmalloc_huge(unsigned long size, gfp_t gfp_mask)
 {
-	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
-				    gfp_mask, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP,
-				    NUMA_NO_NODE, __builtin_return_address(0));
+	return vmalloc_huge_node(size, gfp_mask, NUMA_NO_NODE);
 }
Isn't this going to result in the "caller" being always recorded as
vmalloc_huge() instead of the caller of vmalloc_huge()?
Durr, I missed that, but it depends, not if the compiler inlines it.

I'll make a common __always_inline helper to cure this.
Thread (19 messages) 19 messages, 3 authors, last reply 2023-07-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help