On Fri, Jun 05, 2020 at 03:41:27PM +0100, Robin Murphy wrote: > Ha, and in fact having checked a build out of curiosity, this patch as-is > actually stands to make things considerably worse. At least with GCC 8.3 and > bcm2835_defconfig, bcm2835_spi_interrupt_common() doesn't get inlined, which > means bcm2835_spi_interrupt() pushes/pops a stack frame and makes an > out-of-line call to bcm2835_spi_interrupt_common(), resulting in massively > *more* work than the extra two instructions of simply inlining the test. Whichever compiler I was using (clang-11 probably) did manage to inline the tail call so it really was the two instructions but yeah, in general this approach is going to be fragile. > So yes, the overhead of inlining the test vs. the alternative is indeed > non-zero. It's just also negative :D And variable!