• Alexey Dobriyan's avatar
    kstrtox: uninline everything · 70ac6992
    Alexey Dobriyan authored
    I've made a mistake of looking into lib/kstrtox.o code generation.
    
    The only function remotely performance critical is _parse_integer()
    (via /proc/*/map_files/*), everything else is not.
    
    Uninline everything, shrink lib/kstrtox.o by ~20 % !
    
    Space savings on x86_64:
    
    	add/remove: 0/0 grow/shrink: 0/23 up/down: 0/-1269 (-1269 !!!)
    	Function                                     old     new   delta
    	kstrtoull                                     16      13      -3
    	kstrtouint                                    59      48     -11
    	kstrtou8                                      60      49     -11
    	kstrtou16                                     61      50     -11
    	_kstrtoul                                     46      35     -11
    	kstrtoull_from_user                           95      83     -12
    	kstrtoul_from_user                            95      83     -12
    	kstrtoll                                      93      80     -13
    	kstrtouint_from_user                         124      83     -41
    	kstrtou8_from_user                           125      83     -42
    	kstrtou16_from_user                          126      83     -43
    	kstrtos8                                     101      50     -51
    	kstrtos16                                    102      51     -51
    	kstrtoint                                    100      49     -51
    	_kstrtol                                      93      35     -58
    	kstrtobool_from_user                         156      75     -81
    	kstrtoll_from_user                           165      83     -82
    	kstrtol_from_user                            165      83     -82
    	kstrtoint_from_user                          172      83     -89
    	kstrtos8_from_user                           173      83     -90
    	kstrtos16_from_user                          174      83     -91
    	_parse_integer                               136      10    -126
    	_kstrtoull                                   308     101    -207
    	Total: Before=3421236, After=3419967, chg -0.04%
    
    Link: https://lkml.kernel.org/r/YZDsFDhHst4m2Pnt@localhost.localdomainSigned-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    70ac6992
kstrtox.c 10.8 KB