[PATCH] mutex: Improve mutex_spin_on_owner() code generation

From: Ingo Molnar
Date: Fri Apr 10 2015 - 07:27:59 EST



* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> although the double unrolled need_resched() check looks silly:
>
> 4d: 48 8b 80 10 c0 ff ff mov -0x3ff0(%rax),%rax
> 54: a8 08 test $0x8,%al
>
> 75: 48 8b 81 10 c0 ff ff mov -0x3ff0(%rcx),%rax
> 7c: a8 08 test $0x8,%al

The patch below fixes that and shaves 40 bytes off
mutex_spin_on_owner()'s code size.

Thanks,

Ingo

===================================>