diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 20:58:40 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 20:58:40 -0700 |
commit | dcca3f1669a859735ba15bc80d3cf1e12e68910f (patch) | |
tree | 43a7a8a27ca6d7987d981be71ff9ea9c9ba7eff7 | |
parent | 6661b11c607f825ecb60b172fabeada2668e3695 (diff) | |
download | 25-new-dcca3f1669a859735ba15bc80d3cf1e12e68910f.tar.gz |
foo
-rw-r--r-- | patches/mm-vmalloc-enable-memory-allocation-profiling.patch | 130 |
1 files changed, 41 insertions, 89 deletions
diff --git a/patches/mm-vmalloc-enable-memory-allocation-profiling.patch b/patches/mm-vmalloc-enable-memory-allocation-profiling.patch index 5b8264bbb..8dae9b0be 100644 --- a/patches/mm-vmalloc-enable-memory-allocation-profiling.patch +++ b/patches/mm-vmalloc-enable-memory-allocation-profiling.patch @@ -7,6 +7,10 @@ alloc_hooks() wrapper, and switches internal allocations to _noprof variants where appropriate, for the new memory allocation profiling feature. +[surenb@google.com: arch/um: fix forward declaration for vmalloc] + Link: https://lkml.kernel.org/r/20240326073750.726636-1-surenb@google.com +[surenb@google.com: undo _noprof additions in the documentation] + Link: https://lkml.kernel.org/r/20240326231453.1206227-5-surenb@google.com Link: https://lkml.kernel.org/r/20240321163705.3067592-31-surenb@google.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> Signed-off-by: Suren Baghdasaryan <surenb@google.com> @@ -30,14 +34,27 @@ Cc: Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> --- + arch/um/include/shared/um_malloc.h | 3 drivers/staging/media/atomisp/pci/hmm/hmm.c | 2 - include/linux/vmalloc.h | 60 +++++++++--- + include/linux/vmalloc.h | 60 ++++++++++---- kernel/kallsyms_selftest.c | 2 - mm/nommu.c | 64 ++++++------- - mm/util.c | 24 ++-- - mm/vmalloc.c | 88 +++++++++--------- - 6 files changed, 135 insertions(+), 105 deletions(-) + mm/nommu.c | 56 ++++++------- + mm/util.c | 18 ++-- + mm/vmalloc.c | 74 +++++++++--------- + 7 files changed, 123 insertions(+), 92 deletions(-) +--- a/arch/um/include/shared/um_malloc.h~mm-vmalloc-enable-memory-allocation-profiling ++++ a/arch/um/include/shared/um_malloc.h +@@ -11,7 +11,8 @@ + extern void *uml_kmalloc(int size, int flags); + extern void kfree(const void *ptr); + +-extern void *vmalloc(unsigned long size); ++extern void *vmalloc_noprof(unsigned long size); ++#define vmalloc(...) vmalloc_noprof(__VA_ARGS__) + extern void vfree(void *ptr); + + #endif /* __UM_MALLOC_H__ */ --- a/drivers/staging/media/atomisp/pci/hmm/hmm.c~mm-vmalloc-enable-memory-allocation-profiling +++ a/drivers/staging/media/atomisp/pci/hmm/hmm.c @@ -205,7 +205,7 @@ static ia_css_ptr __hmm_alloc(size_t byt @@ -211,7 +228,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> /* * vzalloc - allocate virtually contiguous memory with zero fill -@@ -237,14 +237,14 @@ void *vmalloc_huge(unsigned long size, g +@@ -237,11 +237,11 @@ void *vmalloc_huge(unsigned long size, g * For tight control over page level allocator and protection flags * use __vmalloc() instead. */ @@ -225,12 +242,8 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vzalloc_noprof); /** -- * vmalloc_node - allocate memory on a specific node -+ * vmalloc_node_noprof - allocate memory on a specific node - * @size: allocation size - * @node: numa node - * -@@ -254,14 +254,14 @@ EXPORT_SYMBOL(vzalloc); + * vmalloc_node - allocate memory on a specific node +@@ -254,11 +254,11 @@ EXPORT_SYMBOL(vzalloc); * For tight control over page level allocator and protection flags * use __vmalloc() instead. */ @@ -244,12 +257,8 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vmalloc_node_noprof); /** -- * vzalloc_node - allocate memory on a specific node with zero fill -+ * vzalloc_node_noprof - allocate memory on a specific node with zero fill - * @size: allocation size - * @node: numa node - * -@@ -272,27 +272,27 @@ EXPORT_SYMBOL(vmalloc_node); + * vzalloc_node - allocate memory on a specific node with zero fill +@@ -272,11 +272,11 @@ EXPORT_SYMBOL(vmalloc_node); * For tight control over page level allocator and protection flags * use __vmalloc() instead. */ @@ -263,10 +272,8 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vzalloc_node_noprof); /** -- * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) -+ * vmalloc_32_noprof - allocate virtually contiguous memory (32bit addressable) - * @size: allocation size - * + * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) +@@ -285,11 +285,11 @@ EXPORT_SYMBOL(vzalloc_node); * Allocate enough 32bit PA addressable pages to cover @size from the * page level allocator and map them into contiguous kernel virtual space. */ @@ -280,11 +287,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vmalloc_32_noprof); /** -- * vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory -+ * vmalloc_32_user_noprof - allocate zeroed virtually contiguous 32bit memory - * @size: allocation size - * - * The resulting memory area is 32bit addressable and zeroed so it can be + * vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory @@ -301,15 +301,15 @@ EXPORT_SYMBOL(vmalloc_32); * VM_USERMAP is set on the corresponding VMA so that subsequent calls to * remap_vmalloc_range() are permissible. @@ -315,13 +318,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> flags, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP, node, __builtin_return_address(0)); } -@@ -715,12 +715,12 @@ void *kvrealloc_noprof(const void *p, si - EXPORT_SYMBOL(kvrealloc_noprof); - - /** -- * __vmalloc_array - allocate memory for a virtually contiguous array. -+ * __vmalloc_array_noprof - allocate memory for a virtually contiguous array. - * @n: number of elements. +@@ -720,7 +720,7 @@ EXPORT_SYMBOL(kvrealloc_noprof); * @size: element size. * @flags: the type of memory to allocate (see kmalloc). */ @@ -338,8 +335,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(__vmalloc_array_noprof); /** -- * vmalloc_array - allocate memory for a virtually contiguous array. -+ * vmalloc_array_noprof - allocate memory for a virtually contiguous array. + * vmalloc_array - allocate memory for a virtually contiguous array. * @n: number of elements. * @size: element size. */ @@ -366,8 +362,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(__vcalloc_noprof); /** -- * vcalloc - allocate and zero memory for a virtually contiguous array. -+ * vcalloc_noprof - allocate and zero memory for a virtually contiguous array. + * vcalloc - allocate and zero memory for a virtually contiguous array. * @n: number of elements. * @size: element size. */ @@ -423,15 +418,6 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> } if (!area->pages) { -@@ -3703,7 +3703,7 @@ fail: - } - - /** -- * __vmalloc_node_range - allocate virtually contiguous memory -+ * __vmalloc_node_range_noprof - allocate virtually contiguous memory - * @size: allocation size - * @align: desired alignment - * @start: vm area range start @@ -3730,7 +3730,7 @@ fail: * * Return: the address of the area or %NULL on failure @@ -441,15 +427,6 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> unsigned long start, unsigned long end, gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, int node, const void *caller) -@@ -3859,7 +3859,7 @@ fail: - } - - /** -- * __vmalloc_node - allocate virtually contiguous memory -+ * __vmalloc_node_noprof - allocate virtually contiguous memory - * @size: allocation size - * @align: desired alignment - * @gfp_mask: flags for the page level allocator @@ -3877,10 +3877,10 @@ fail: * * Return: pointer to the allocated memory or %NULL on error @@ -499,7 +476,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> /** * vmalloc_huge - allocate virtually contiguous memory, allow huge pages -@@ -3930,16 +3930,16 @@ EXPORT_SYMBOL(vmalloc); +@@ -3930,13 +3930,13 @@ EXPORT_SYMBOL(vmalloc); * * Return: pointer to the allocated memory or %NULL on error */ @@ -515,11 +492,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL_GPL(vmalloc_huge_noprof); /** -- * vzalloc - allocate virtually contiguous memory with zero fill -+ * vzalloc_noprof - allocate virtually contiguous memory with zero fill - * @size: allocation size - * - * Allocate enough pages to cover @size from the page level + * vzalloc - allocate virtually contiguous memory with zero fill @@ -3951,12 +3951,12 @@ EXPORT_SYMBOL_GPL(vmalloc_huge); * * Return: pointer to the allocated memory or %NULL on error @@ -536,7 +509,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> /** * vmalloc_user - allocate zeroed virtually contiguous memory for userspace -@@ -3967,17 +3967,17 @@ EXPORT_SYMBOL(vzalloc); +@@ -3967,14 +3967,14 @@ EXPORT_SYMBOL(vzalloc); * * Return: pointer to the allocated memory or %NULL on error */ @@ -553,12 +526,8 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vmalloc_user_noprof); /** -- * vmalloc_node - allocate memory on a specific node -+ * vmalloc_node_noprof - allocate memory on a specific node - * @size: allocation size - * @node: numa node - * -@@ -3989,15 +3989,15 @@ EXPORT_SYMBOL(vmalloc_user); + * vmalloc_node - allocate memory on a specific node +@@ -3989,12 +3989,12 @@ EXPORT_SYMBOL(vmalloc_user); * * Return: pointer to the allocated memory or %NULL on error */ @@ -573,11 +542,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vmalloc_node_noprof); /** -- * vzalloc_node - allocate memory on a specific node with zero fill -+ * vzalloc_node_noprof - allocate memory on a specific node with zero fill - * @size: allocation size - * @node: numa node - * + * vzalloc_node - allocate memory on a specific node with zero fill @@ -4007,12 +4007,12 @@ EXPORT_SYMBOL(vmalloc_node); * * Return: pointer to the allocated memory or %NULL on error @@ -594,16 +559,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32) #define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL) -@@ -4027,7 +4027,7 @@ EXPORT_SYMBOL(vzalloc_node); - #endif - - /** -- * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) -+ * vmalloc_32_noprof - allocate virtually contiguous memory (32bit addressable) - * @size: allocation size - * - * Allocate enough 32bit PA addressable pages to cover @size from the -@@ -4035,15 +4035,15 @@ EXPORT_SYMBOL(vzalloc_node); +@@ -4035,12 +4035,12 @@ EXPORT_SYMBOL(vzalloc_node); * * Return: pointer to the allocated memory or %NULL on error */ @@ -618,11 +574,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +EXPORT_SYMBOL(vmalloc_32_noprof); /** -- * vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory -+ * vmalloc_32_user_noprof - allocate zeroed virtually contiguous 32bit memory - * @size: allocation size - * - * The resulting memory area is 32bit addressable and zeroed so it can be + * vmalloc_32_user - allocate zeroed virtually contiguous 32bit memory @@ -4051,14 +4051,14 @@ EXPORT_SYMBOL(vmalloc_32); * * Return: pointer to the allocated memory or %NULL on error |