lkml.org 
[lkml]   [2008]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH [RT] 08/14] add a loop counter based timeout mechanism
On Fri, Feb 22, 2008 at 11:21:14AM -0800, Bill Huey (hui) wrote:
> On Fri, Feb 22, 2008 at 11:19 AM, Bill Huey (hui) <bill.huey@gmail.com> wrote:
> > Yeah, I'm not very keen on having a constant there without some
> > contention instrumentation to see how long the spins are. It would be
> > better to just let it run until either task->on_cpu is off or checking
> > if the "current" in no longer matches the mutex owner for the runqueue
> > in question. At that point, you know the thread isn't running.
> > Spinning on something like that is just a waste of time. It's for that
> > reason that doing in the spin outside of a preempt critical section
> > isn't really needed
>
> Excuse me, I meant to say "...isn't a problem".

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.

I believe that there are locks in the Linux kernel that have this
"mostly short but sometimes long" hold-time property.

Thanx, Paul


\
 
 \ /
  Last update: 2008-02-22 20:47    [W:0.055 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site