Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-26 Thread Gregory Haskins
>>> On Tue, Feb 26, 2008 at 1:06 PM, in message <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]> wrote: > On Tue 2008-02-26 08:03:43, Gregory Haskins wrote: >> >>> On Mon, Feb 25, 2008 at 5:03 PM, in message >> <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]> wrote: >> >> >> +static

Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-26 Thread Pavel Machek
On Tue 2008-02-26 08:03:43, Gregory Haskins wrote: > >>> On Mon, Feb 25, 2008 at 5:03 PM, in message > <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]> wrote: > > >> +static inline void > >> +prepare_adaptive_wait(struct rt_mutex *lock, struct adaptive_waiter > > *adaptive) > > ... > >> +#

Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-26 Thread Gregory Haskins
>>> On Mon, Feb 25, 2008 at 5:03 PM, in message <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]> wrote: >> +static inline void >> +prepare_adaptive_wait(struct rt_mutex *lock, struct adaptive_waiter > *adaptive) > ... >> +#define prepare_adaptive_wait(lock, busy) {} > > This is evil. Use

Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-25 Thread Gregory Haskins
>>> On Mon, Feb 25, 2008 at 5:03 PM, in message <[EMAIL PROTECTED]>, Pavel Machek <[EMAIL PROTECTED]> wrote: > Hi! > >> +/* >> + * Adaptive-rtlocks will busywait when possible, and sleep only if >> + * necessary. Note that the busyloop looks racy, and it isbut we do >> + * not care. If we lo

Re: [(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-25 Thread Pavel Machek
Hi! > +/* > + * Adaptive-rtlocks will busywait when possible, and sleep only if > + * necessary. Note that the busyloop looks racy, and it isbut we do > + * not care. If we lose any races it simply means that we spin one more > + * time before seeing that we need to break-out on the next itera

[(RT RFC) PATCH v2 5/9] adaptive real-time lock support

2008-02-25 Thread Gregory Haskins
There are pros and cons when deciding between the two basic forms of locking primitives (spinning vs sleeping). Without going into great detail on either one, we note that spinlocks have the advantage of lower overhead for short hold locks. However, they also have a con in that they create indete