Skip to contentSkip to conversation

mm: uninline kstrdup()

PATCH New Alexey Dobriyan 1 participant 1 message Feb 28, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

 mm/util.c |    1 +
 1 file changed, 1 insertion(+)
mm/util.c +1 -0
@@ -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;