diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2023-02-28 16:34:38 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-04-08 22:45:37 +0200 |
commit | 2a6772ebf05a9b6bc450e42bbb459f6327f68aca (patch) | |
tree | 76fe43ab8ac8adac47b9af33aca8edeb04707a87 /mm/util.c | |
parent | scripts/gdb: support getting current task struct in UML (diff) | |
download | linux-2a6772ebf05a9b6bc450e42bbb459f6327f68aca.tar.xz linux-2a6772ebf05a9b6bc450e42bbb459f6327f68aca.zip |
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 <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c index b8ed9dbc7fd5..dd12b9531ac4 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; |