svn commit: r274489 - in head/sys/amd64: amd64 include

David Chisnall theraven at FreeBSD.org
Sun Nov 23 16:22:43 UTC 2014


On 21 Nov 2014, at 23:26, Scott Long <scott4long at yahoo.com> wrote:

> That’s a good question to look further into.  I didn’t see any measurable differences with this change.  I think that the cost of the function call itself masks the cost of a few extra instructions, but I didn’t test with switching it on/off for the entire kernel

[ Note: The following is not specific to the kernel ]

The overhead for preserving / omitting the frame pointer is decidedly nonlinear.  On a modern superscalar processor, it will usually be effectively zero, right up until the point that it pushes something out of the instruction cache on a hot path, at which point it jumps to 20-50%, depending on the workload.

The performance difference was more pronounced on i386, where having an extra GPR for the register allocator to use could make a 10-20% performance difference on some fairly common code (the two big performance wins for x86-64 over IA32 were the increase in number of GPRs and an FPU ISA that wasn't batshit insane).  For ISAs with more GPRs, that's less of an issue, although after inlining being able to use %rbp as a GPR can sometimes make a noticeable difference in performance.  In particular, as %rpb is callee-save, it's very useful to be able to use it in non-leaf functions.

David



More information about the svn-src-all mailing list