[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53991FB4.2060001@cn.fujitsu.com>
Date: Thu, 12 Jun 2014 11:34:12 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Oleg Nesterov <oleg@...hat.com>
Subject: Re: [patch V4 02/10] rtmutex: Simplify rtmutex_slowtrylock()
On 06/12/2014 02:44 AM, Thomas Gleixner wrote:
> Oleg noticed that rtmutex_slowtrylock() has a pointless check for
> rt_mutex_owner(lock) != current.
>
> To avoid calling try_to_take_rtmutex() we really want to check whether
> the lock has an owner at all or whether the trylock failed because the
> owner is NULL, but the RT_MUTEX_HAS_WAITERS bit is set. This covers
> the lock is owned by caller situation as well.
>
> We can actually do this check lockless. trylock is taking a chance
> whether we take lock->wait_lock to do the check or not.
>
> Add comments to the function while at it.
>
> Reported-by: Oleg Nesterov <oleg@...hat.com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
Reviewed-by: Lai Jiangshan <laijs@...fujitsu.com>
Thanks,
Lai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists