Inline vfat_strnicmp()
PATCH 1/1 Inline vfat_strnicmp()
Hi,
the function vfat_strnicmp() has just one callsite. Inlining it actually shrinks vfat.o slightly.
René
fs/vfat/namei.c renamed from fs/vfat/namei.c~ +1 -1
@@ -103,7 +103,7 @@return nc ? nc : c; } -static int +static inline int vfat_strnicmp (struct nls_table *t,const unsigned char *s1,const unsigned char *s2,int len) {
Quoted 2 lines · Ren
the function
vfat_strnicmp()has just one callsite. Inlining it actually shrinks vfat.o slightly.
Thanks. I'll submit this patch to Linus.
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 6 lines · OGAWA Hirofumi
Quoted 2 lines · Ren
the function
vfat_strnicmp()has just one callsite. Inlining it actually shrinks vfat.o slightly.Thanks. I'll submit this patch to Linus.
Just to deinline it in some months?
Come on, automatically inlining static functions with just one callsite is a compiler's job. Don't do it. --
vda
Quoted 6 lines · Denis Vlasenko
Quoted 5 lines · OGAWA Hirofumi
Quoted 2 lines · Ren
the function
vfat_strnicmp()has just one callsite. Inlining it actually shrinks vfat.o slightly.
Quoted 6 lines
Quoted 1 line
Thanks. I'll submit this patch to Linus.
Just to deinline it in some months?
Come on, automatically inlining static functions with just one callsite is a compiler's job. Don't do it.
Unfortunately "gcc version 3.2.3 20030415 (Debian prerelease)" doesn't, at least.
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 10 lines · OGAWA Hirofumi
Quoted 8 lines · Denis Vlasenko
Quoted 6 lines · OGAWA Hirofumi
Quoted 2 lines · Ren
the function
vfat_strnicmp()has just one callsite. Inlining it actually shrinks vfat.o slightly.Thanks. I'll submit this patch to Linus.
Quoted 7 lines
Quoted 4 lines
Just to deinline it in some months?
Come on, automatically inlining static functions with just one callsite is a compiler's job. Don't do it.
Unfortunately "gcc version 3.2.3 20030415 (Debian prerelease)" doesn't, at least.
And how big is the performance loss? Is it even measurable? And even if it is, is optimizing this really worth the trouble?
Regards: David Weinehall
Signature · 3 lines
/) David Weinehall <[email protected]> /) Northern lights wander (\ // Maintainer of the v2.0 kernel // Dance across the winter sky // \) http://www.acc.umu.se/~tao/ (/ Full colour fire (/
Quoted 10 lines · OGAWA Hirofumi
Quoted 8 lines · Denis Vlasenko
Quoted 6 lines · OGAWA Hirofumi
Quoted 2 lines · Ren
the function
vfat_strnicmp()has just one callsite. Inlining it actually shrinks vfat.o slightly.Thanks. I'll submit this patch to Linus.
Quoted 7 lines
Quoted 4 lines
Just to deinline it in some months?
Come on, automatically inlining static functions with just one callsite is a compiler's job. Don't do it.
Unfortunately "gcc version 3.2.3 20030415 (Debian prerelease)" doesn't, at least.
Yes, but some future version would.
Since there is no substantial wins in hunting down
such statics, and there is some risk of code bloat when big inlined statics get called from more that one callsite, and it will be automatically handled by smarter compiler someday, I think it makes perfect sense to avoid doing this.
--
vda
Quoted 2 lines · David Weinehall
And how big is the performance loss? Is it even measurable? And even if it is, is optimizing this really worth the trouble?
48bytes smaller than prev. I think It's not a clear reason for rejecting a patch.
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 7 lines · Denis Vlasenko
Yes, but some future version would.
Since there is no substantial wins in hunting down
such statics, and there is some risk of code bloat when big inlined statics get called from more that one callsite, and it will be automatically handled by smarter compiler someday, I think it makes perfect sense to avoid doing this.
Could you tell me, if compiler does it in future? I'll gladly kill that inline.
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Quoted 4 lines · OGAWA Hirofumi
Quoted 2 lines · Denis Vlasenko
Yes, but some future version would.
Quoted 8 lines
Quoted 5 lines
Since there is no substantial wins in hunting down
such statics, and there is some risk of code bloat when big inlined statics get called from more that one callsite, and it will be automatically handled by smarter compiler someday, I think it makes perfect sense to avoid doing this.Could you tell me, if compiler does it in future? I'll gladly kill that inline.
I can't be 100.00% sure it will happen. I'd say 98.234235% ;)
Andrew Morton kills extra large inlines, and you are creating them :( That's not ok. Just leave those poor static functions alone until compiler will do them, all at once.
There are lots of other stuff to do in the kernel source. --
vda
Quoted 6 lines · Denis Vlasenko
I can't be 100.00% sure it will happen. I'd say 98.234235% ;)
Andrew Morton kills extra large inlines, and you are creating them :( That's not ok. Just leave those poor static functions alone until compiler will do them, all at once.
There are lots of other stuff to do in the kernel source.
- That's smaller than prev in *real world*.
- You don't fix compiler.
End of story.
Signature · 1 line
OGAWA Hirofumi <[email protected]>