From: Alexey Dobriyan Date: Tue, 28 Feb 2023 15:34:38 +0000 (+0300) Subject: mm: uninline kstrdup() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2a6772ebf05a9b6bc450e42bbb459f6327f68aca;p=linux.git mm: uninline kstrdup() 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 Link: https://lkml.kernel.org/r/Y/4fDlbIhTLNLFHz@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton --- diff --git a/mm/util.c b/mm/util.c index b8ed9dbc7fd55..dd12b9531ac4c 100644 --- 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;