Because this increases the code density of the common
case, getting the lock immediately.
> Question 2: What is the purpose of the code sequence, "repz nop"
> generated by the spin-lock code? Is this a processor BUG work-around?
> `as` doesn't "like" this sequence and, Intel doesn't seem to
> document it.
It is a hint to the processor that we are executing a spinlock loop
(it does something wrt. keeping the cacheline of the lock in shared
state when possible).
I believe it is documented in the Pentium 4 manuals, previous chips
ignore this sequence and treat it as a pure nop from what I understand.
Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/