On Tue, Aug 5, 2014 at 4:53 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Aug 5, 2014 7:36 PM, "Denys Vlasenko" <vda.li...@googlemail.com> wrote: >> Then old_rsp can be nuked everywhere else, >> RESTORE_TOP_OF_STACK can be nuked, and >> FIXUP_TOP_OF_STACK can be reduced to merely: >> >> movq $__USER_DS,SS(%rsp) >> movq $__USER_CS,CS(%rsp) > > Mmm, right. That's probably better than doing this on the fast path.
I measured it. These particular insns have a nasty huge encoding in x86 - 12 bytes each, no less! 48 c7 84 24 88 00 00 00 33 00 00 00 movq $0x33,0x88(%rsp) 48 c7 84 24 a0 00 00 00 2b 00 00 00 movq $0x2b,0xa0(%rsp) With them in hot path, I measure 55.6 ns per syscall, with them moved out of hot path it's 54.8 ns. This is 2.70GHz CPU, so it must be 2 CPU cycles. -- vda -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/