Skip to content

Commit f7a35a3

Browse files
keesakpm00
authored andcommitted
mm: vmalloc: actually use the in-place vrealloc region
Patch series "mm: vmalloc: Actually use the in-place vrealloc region". This fixes a performance regression[1] with vrealloc()[1]. The refactoring to not build a new vmalloc region only actually worked when shrinking. Actually return the resized area when it grows. Ugh. Link: https://lkml.kernel.org/r/[email protected] Fixes: a0309fa ("mm: vmalloc: support more granular vrealloc() sizing") Signed-off-by: Kees Cook <[email protected]> Reported-by: Shung-Hsi Yu <[email protected]> Closes: https://lore.kernel.org/all/20250515-bpf-verifier-slowdown-vwo2meju4cgp2su5ckj@6gi6ssxbnfqg [1] Tested-by: Eduard Zingerman <[email protected]> Tested-by: Pawan Gupta <[email protected]> Tested-by: Shung-Hsi Yu <[email protected]> Reviewed-by: "Uladzislau Rezki (Sony)" <[email protected]> Reviewed-by: Danilo Krummrich <[email protected]> Cc: "Erhard F." <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 12ca42c commit f7a35a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/vmalloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,6 +4111,7 @@ void *vrealloc_noprof(const void *p, size_t size, gfp_t flags)
41114111
if (want_init_on_alloc(flags))
41124112
memset((void *)p + old_size, 0, size - old_size);
41134113
vm->requested_size = size;
4114+
return (void *)p;
41144115
}
41154116

41164117
/* TODO: Grow the vm_area, i.e. allocate and map additional pages. */

0 commit comments

Comments
 (0)