+ if (!(head % 7) && delay < MAX_SPINLOCK_DELAY)
+ delay++;
+
+ loops = delay * waiters_ahead;
I don't like the head % 7 thing. I think using fixed point arithmetic
would be nicer:
if (delay < MAX_SPINLOCK_DELAY)
delay += 256/7; /* Or whatever constant we choose */
loops = (delay * waiter_ahead) >> 8;
I'll do that. That could get completely rid of any artifacts
caused by incrementing sometimes, and not other times.
Also, we should probably skip the delay increment on the first loop
iteration - after all, we haven't waited yet, so we can't say that the
delay was too short.
Good point. I will do that.
I will build a kernel with the things you pointed out fixed,
and will give it a spin this afternoon.
Expect new patches soonish :)