* [PATCH] mm: vrealloc: fix missing nommu implementation
@ 2024-07-25 14:11 Danilo Krummrich
0 siblings, 0 replies; only message in thread
From: Danilo Krummrich @ 2024-07-25 14:11 UTC (permalink / raw)
To: akpm, urezki, hch; +Cc: mhocko, linux-kernel, linux-mm, Danilo Krummrich
Commit 5ec6d992f460 ("mm: vmalloc: implement vrealloc()") introduces
vrealloc(), but lacks the implementation of the nommu version of this
function.
Note that currently nommu isn't actually broken without this. The only
user, kvrealloc(), never actually calls into vrealloc() with nommu, since
it's guarded by is_vmalloc_addr(), which for nommu always returns false.
However, since this becomes a real issue once vrealloc() is used by
other code, fix this.
Fixes: 5ec6d992f460 ("mm: vmalloc: implement vrealloc()")
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
@Andrew: I picked up the commit id from mm/mm-unstable, which probably
isn't correct / will change.
Please let me know if you'll take care or if you want me to just send a
v3 of the original series.
---
mm/nommu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mm/nommu.c b/mm/nommu.c
index 7296e775e04e..40cac1348b40 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -126,6 +126,11 @@ void *__vmalloc_noprof(unsigned long size, gfp_t gfp_mask)
}
EXPORT_SYMBOL(__vmalloc_noprof);
+void *vrealloc_noprof(const void *p, size_t size, gfp_t flags)
+{
+ return krealloc_noprof(p, size, (flags | __GFP_COMP) & ~__GFP_HIGHMEM);
+}
+
void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align,
unsigned long start, unsigned long end, gfp_t gfp_mask,
pgprot_t prot, unsigned long vm_flags, int node,
base-commit: d270beaca6818349b2aed7e6034b800a777087cc
--
2.45.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-25 14:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-25 14:11 [PATCH] mm: vrealloc: fix missing nommu implementation Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox