linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()
@ 2011-01-11  4:17 Steven Rostedt
  2011-01-11 11:09 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2011-01-11  4:17 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Thomas Gleixner, Andrew Morton, Darren Hart,
	Lai Jiangshan


Ingo,

While porting Lai Jiangshan's rt-pi patch to the -rt kernel, I found
that the comment about why rt_mutex_next_owner() can return NULL is
incorrect. This caused Lai to remove the following if condition, which
caused a bit of headache in debugging why his patch was causing a crash.

Please pull the latest tip/futex tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/futex


Steven Rostedt (1):
      rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()

----
 kernel/futex.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---------------------------
commit 03cb8f564241019619d52b8716a8194b4220871c
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Thu Jan 6 15:08:29 2011 -0500

    rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()
    
    The comment about why rt_mutex_next_owner() can return NULL in
    wake_futex_pi() is not the normal case.
    
    Tracing the cause of why this occurs is more likely that waiter
    simply timedout. But because it originally caused contention with
    the futex, the owner will go into the kernel when it unlocks
    the lock. Then it will hit this code path and
    rt_mutex_next_owner() will return NULL.
    
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/futex.c b/kernel/futex.c
index 3019b92..5696d38 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -791,10 +791,9 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)
 	new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
 
 	/*
-	 * This happens when we have stolen the lock and the original
-	 * pending owner did not enqueue itself back on the rt_mutex.
-	 * Thats not a tragedy. We know that way, that a lock waiter
-	 * is on the fly. We make the futex_q waiter the pending owner.
+	 * It is possible that the next waiter (the one that brought
+	 * this owner to the kernel) timed out and is no longer
+	 * waiting on the lock.
 	 */
 	if (!new_owner)
 		new_owner = this->task;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()
  2011-01-11  4:17 [GIT PULL] rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi() Steven Rostedt
@ 2011-01-11 11:09 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2011-01-11 11:09 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Thomas Gleixner, Andrew Morton, Darren Hart, Lai Jiangshan


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> Ingo,
> 
> While porting Lai Jiangshan's rt-pi patch to the -rt kernel, I found
> that the comment about why rt_mutex_next_owner() can return NULL is
> incorrect. This caused Lai to remove the following if condition, which
> caused a bit of headache in debugging why his patch was causing a crash.
> 
> Please pull the latest tip/futex tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/futex
> 
> 
> Steven Rostedt (1):
>       rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()
> 
> ----
>  kernel/futex.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)

Pulled into tip:core/urgent, thanks Steve!

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-11 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11  4:17 [GIT PULL] rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi() Steven Rostedt
2011-01-11 11:09 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).