[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140531155437.7cb833bf@gandalf.local.home>
Date: Sat, 31 May 2014 15:54:37 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
Jason Low <jason.low2@...com>
Subject: Re: [patch v2 3/5] rtmutex: Confine deadlock logic to futex
On Sat, 31 May 2014 15:57:50 -0000
Thomas Gleixner <tglx@...utronix.de> wrote:
> ===================================================================
> --- tip.orig/kernel/locking/rtmutex.c
> +++ tip/kernel/locking/rtmutex.c
> @@ -904,16 +904,15 @@ rt_mutex_slowunlock(struct rt_mutex *loc
> */
> static inline int
> rt_mutex_fastlock(struct rt_mutex *lock, int state,
> - enum rtmutex_chainwalk detect_deadlock,
> int (*slowfn)(struct rt_mutex *lock, int state,
> struct hrtimer_sleeper *timeout,
> enum rtmutex_chainwalk detect_deadlock))
> {
> - if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
> + if (likely(rt_mutex_cmpxchg(lock, NULL, current))) {
> rt_mutex_deadlock_account_lock(lock, current);
> return 0;
> } else
> - return slowfn(lock, state, NULL, detect_deadlock);
> + return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK);
> }
>
> static inline int
> @@ -924,7 +923,7 @@ rt_mutex_timed_fastlock(struct rt_mutex
> struct hrtimer_sleeper *timeout,
> enum rtmutex_chainwalk detect_deadlock))
> {
> - if (!detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
> + if (detect_deadlock && likely(rt_mutex_cmpxchg(lock, NULL, current))) {
Did you mean to remove that "!"? Don't we want to call the slowfn all
the time if detect_deadlock is FULL?
-- Steve
> rt_mutex_deadlock_account_lock(lock, current);
> return 0;
> } else
> @@ -961,55 +960,59 @@ void __sched rt_mutex_lock(struct rt_mut
> {
> might_sleep();
>
> - rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, RT_MUTEX_MIN_CHAINWALK,
> - rt_mutex_slowlock);
> + rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock);
> }
> EXPORT_SYMBOL_GPL(rt_mutex_lock);
--
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