Re: [PATCH 5/5] remove the extra call to try_to_take_lock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Haskins
Date: Friday, May 23, 2008 - 8:30 pm

>>> On Fri, May 23, 2008 at 11:02 PM, in message
<Pine.LNX.4.58.0805232301080.12686@gandalf.stny.rr.com>, Steven Rostedt
<rostedt@goodmis.org> wrote: 


Its not that we are saying it doesn't happen.  Rather, we are saying the overhead of exiting from the second call (and only remaining call after this patch) is not as significant as it would seem on paper (based on empirical data).  In essence, it adds an xchg to the steal-case which is not "great", but....

..conversely, if the first test fails, the second test will *always* fail (since the lock->wait_lock is held across both).  This extra overhead actually *does* result in a measurable degradation of performance in our testing.

Another way to write the patch is to do more of a "do/while" style with the try_to_take is done later in the loop.  You could then retain the fast-path exit in that case.  I actually wrote a patch like that at one point, but I think Peter's here was faster.  I don't recall the reason why that was off the top of my head, but I remember I dropped my patch in favor of his because of the difference.

Regards,
-Greg



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/5] RT: adaptive-lock enhancements, Gregory Haskins, (Tue May 20, 7:49 am)
[PATCH 1/5] optimize rt lock wakeup, Gregory Haskins, (Tue May 20, 7:49 am)
[PATCH 3/5] rtmutex: use task-&gt;oncpu to save a call, Gregory Haskins, (Tue May 20, 7:49 am)
[PATCH 4/5] adjust pi_lock usage in wakeup, Gregory Haskins, (Tue May 20, 7:49 am)
[PATCH 5/5] remove the extra call to try_to_take_lock, Gregory Haskins, (Tue May 20, 7:49 am)
Re: [PATCH 5/5] remove the extra call to try_to_take_lock, Steven Rostedt, (Fri May 23, 8:02 pm)
Re: [PATCH 5/5] remove the extra call to try_to_take_lock, Gregory Haskins, (Fri May 23, 8:30 pm)
Re: [PATCH 5/5] remove the extra call to try_to_take_lock, Peter W. Morreale, (Sat May 24, 7:11 am)