All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 4/5][RT] rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()
Date: Mon, 10 Jan 2011 22:53:59 -0500	[thread overview]
Message-ID: <20110111035720.548276314@goodmis.org> (raw)
In-Reply-To: 20110111035355.643480133@goodmis.org

[-- Attachment #1: 0004-rtmutex-Fix-comment-about-why-new_owner-can-be-NULL-.patch --]
[-- Type: text/plain, Size: 1310 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

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.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/futex.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 07cd774..b9abcfd 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -777,10 +777,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;
-- 
1.7.2.3



  parent reply	other threads:[~2011-01-11  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11  3:53 [PATCH 0/5][RT] [GIT PULL] rt: Port of Lai Jiangshan's rt patch Steven Rostedt
2011-01-11  3:53 ` [PATCH 1/5][RT] rtmutex: Only save lock depth once in spin_slowlock Steven Rostedt
2011-01-11  3:53 ` [PATCH 2/5][RT] rtmutex: Try to take lock early in rt_spin_lock_slowlock() Steven Rostedt
2011-01-11  3:53 ` [PATCH 3/5][RT] rtmutex: Revert Optimize rt lock wakeup Steven Rostedt
2011-01-11  3:53 ` Steven Rostedt [this message]
2011-01-11  3:54 ` [PATCH 5/5][RT] rtmutex: Ensure only the top waiter or higher priority task can take the lock Steven Rostedt
2011-01-11  8:24 ` [PATCH 0/5][RT] [GIT PULL] rt: Port of Lai Jiangshan's rt patch Thomas Gleixner

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=20110111035720.548276314@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.