lkml.org 
[lkml]   [2008]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] remove the extra call to try_to_take_lock

On Tue, 20 May 2008, Gregory Haskins wrote:

> From: Peter W. Morreale <pmorreale@novell.com>
>
> Remove the redundant attempt to get the lock. While it is true that the
> exit path with this patch adds an un-necessary xchg (in the event the
> lock is granted without further traversal in the loop) experimentation
> shows that we almost never encounter this situation.
>
> Signed-off-by: Peter W. Morreale <pmorreale@novell.com>
> Signed-off-by: Gregory Haskins <ghaskins@novell.com>
> ---
>
> kernel/rtmutex.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
> index ec1f7d4..1da7813 100644
> --- a/kernel/rtmutex.c
> +++ b/kernel/rtmutex.c
> @@ -785,12 +785,6 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
> spin_lock_irqsave(&lock->wait_lock, flags);
> init_lists(lock);
>
> - /* Try to acquire the lock again: */
> - if (do_try_to_take_rt_mutex(lock, STEAL_LATERAL)) {
> - spin_unlock_irqrestore(&lock->wait_lock, flags);
> - return;
> - }
> -

This would suggested that lock stealing doesn't happen. On lock stealing,
this is the condition that is triggered and we have a nice quick exit.

-- Steve



> BUG_ON(rt_mutex_owner(lock) == current);
>
> /*
>


\
 
 \ /
  Last update: 2008-05-24 05:05    [W:0.053 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site