Re: [PATCH [RT] 08/14] add a loop counter based timeout mechanism

From: Peter W. Morreale
Date: Fri Feb 22 2008 - 15:15:57 EST


On Fri, 2008-02-22 at 11:43 -0800, Paul E. McKenney wrote:
>
> The fixed-time spins are very useful in cases where the critical section
> is almost always very short but can sometimes be very long. In such
> cases, you would want to spin until either ownership changes or it is
> apparent that the current critical-section instance will be long.
>

This is what the adaptive patch set does. All current spinners exit the
loop on an owner change.

In this case each "spinner" will traverse the outer rt lock loop and
re-attempt to acquire the lock. If unsuccessful, the task will re-enter
the adaptive wait loop again, providing that there are still "timeout"
iterations left for that particular task.

I do have some stats on the rt lock/adaptive algorithm from a crude
patch used during development. As Bill has noted, the correct way to
obtain these would be to extend lockstats. It was just more expedient
to create this crude patch at the time. If it is helpful to look at
these results in the meantime, I can easily make them, as well as the
patch, available.


-PWM

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/