• Rusty Russell's avatar
    lguest: optimize by coding restore_flags and irq_enable in assembler. · 61f4bc83
    Rusty Russell authored
    The downside of the last patch which made restore_flags and irq_enable
    check interrupts is that they are now too big to be patched directly
    into the callsites, so the C versions are always used.
    
    But the C versions go via PV_CALLEE_SAVE_REGS_THUNK which saves all
    the registers.  In fact, we don't need any registers in the fast path,
    so we can do better than this if we actually code them in assembler.
    
    The results are in the noise, but since it's about the same amount of
    code, it's worth applying.
    
    1GB Guest->Host: input(suppressed),output(suppressed)
    Before:
    	Seconds: 0:16.53
    	Packets: 377268,753673
    	Interrupts: 22461,24297
    	Notifications: 1(5245),21303(732370)
    	Net IRQs triggered: 377023(245),42578(711095)
    
    After:
    	Seconds: 0:16.48
    	Packets: 377289,753673
    	Interrupts: 22281,24465
    	Notifications: 1(5245),21296(732377)
    	Net IRQs triggered: 377060(229),42564(711109)
    Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
    61f4bc83
boot.c 42.9 KB