public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
	stable-rt@vger.kernel.org
Subject: [PATCH RT 1/4] sched: ttwu: Return success when only changing the saved_state value
Date: Tue, 17 Jan 2012 22:45:32 -0500	[thread overview]
Message-ID: <20120118034659.876968220@goodmis.org> (raw)
In-Reply-To: 20120118034531.335521323@goodmis.org

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

From: Thomas Gleixner <tglx@linutronix.de>

When a task blocks on a rt lock, it saves the current state in
p->saved_state, so a lock related wake up will not destroy the
original state.

When a real wakeup happens, while the task is running due to a lock
wakeup already, we update p->saved_state to TASK_RUNNING, but we do
not return success, which might cause another wakeup in the waitqueue
code and the task remains in the waitqueue list. Return success in
that case as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/sched.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 63aeba0..e5ef7a8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2693,8 +2693,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 		 * if the wakeup condition is true.
 		 */
 		if (!(wake_flags & WF_LOCK_SLEEPER)) {
-			if (p->saved_state & state)
+			if (p->saved_state & state) {
 				p->saved_state = TASK_RUNNING;
+				success = 1;
+			}
 		}
 		goto out;
 	}
-- 
1.7.8.3



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-01-18  3:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  3:45 [PATCH RT 0/4] [ANNOUNCE] 3.0.14-rt32-rc1 Steven Rostedt
2012-01-18  3:45 ` Steven Rostedt [this message]
2012-01-18  3:45 ` [PATCH RT 2/4] wait-simple: Simple waitqueue implementation Steven Rostedt
2012-01-18  9:28   ` Mike Galbraith
2012-01-18 12:45     ` Steven Rostedt
2012-01-18 13:40       ` Mike Galbraith
2012-01-18 15:39         ` Steven Rostedt
2012-01-18  3:45 ` [PATCH RT 3/4] acpi-gpe-use-wait-simple.patch Steven Rostedt
2012-01-18  3:45 ` [PATCH RT 4/4] Linux 3.0.14-rt32-rc1 Steven Rostedt
2012-01-18  4:21 ` [PATCH RT 0/4] [ANNOUNCE] 3.0.14-rt32-rc1 Steven Rostedt
2012-01-18 13:50 ` Tim Sander
2012-01-18 15:41   ` Steven Rostedt
2012-01-24  8:40     ` Tim Sander

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=20120118034659.876968220@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stable-rt@vger.kernel.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