mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Jason Low <jason.low2@hp.com>
Subject: Re: [patch v2 3/5] rtmutex: Confine deadlock logic to futex
Date: Sat, 31 May 2014 15:54:37 -0400	[thread overview]
Message-ID: <20140531155437.7cb833bf@gandalf.local.home> (raw)
In-Reply-To: <20140531155739.340193331@linutronix.de>

On Sat, 31 May 2014 15:57:50 -0000
Thomas Gleixner <tglx@linutronix.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);

  reply	other threads:[~2014-05-31 19:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-31 15:57 [patch v2 0/5] rtmutex: Code clarification and optimization Thomas Gleixner
2014-05-31 15:57 ` [patch v2 1/5] rtmutex: Remove builtin tester Thomas Gleixner
2014-05-31 19:55   ` Steven Rostedt
2014-05-31 15:57 ` [patch v2 2/5] rtmutex: Cleanup deadlock detector debug logic Thomas Gleixner
2014-05-31 20:00   ` Steven Rostedt
2014-06-04 13:17     ` Thomas Gleixner
2014-06-04 19:54       ` Steven Rostedt
2014-06-04 19:56         ` Thomas Gleixner
2014-05-31 15:57 ` [patch v2 3/5] rtmutex: Confine deadlock logic to futex Thomas Gleixner
2014-05-31 19:54   ` Steven Rostedt [this message]
2014-05-31 20:35     ` Thomas Gleixner
2014-05-31 15:57 ` [patch v2 4/5] rtmutex: Clarify the lock chain walk Thomas Gleixner
2014-05-31 20:03   ` Steven Rostedt
2014-05-31 15:57 ` [patch v2 5/5] rtmutex: Avoid pointless requeueing in the deadlock detection " Thomas Gleixner
2014-06-02 14:14   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140531155437.7cb833bf@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=jason.low2@hp.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®