* [PATCH] mm: uninline kstrdup()
@ 2023-02-28 15:34 Alexey Dobriyan
0 siblings, 0 replies; only message in thread
From: Alexey Dobriyan @ 2023-02-28 15:34 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
gcc inlines kstrdup into kstrdup_const() but it can very efficiently
tail call into it instead:
$ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-84 (-84)
Function old new delta
kstrdup_const 119 35 -84
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
mm/util.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/util.c
+++ b/mm/util.c
@@ -49,6 +49,7 @@ EXPORT_SYMBOL(kfree_const);
*
* Return: newly allocated copy of @s or %NULL in case of error
*/
+noinline
char *kstrdup(const char *s, gfp_t gfp)
{
size_t len;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-28 15:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28 15:34 [PATCH] mm: uninline kstrdup() Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox