LKML Archive on
help / color / mirror / Atom feed
From: Davidlohr Bueso <>
To: Peter Zijlstra <>, Ingo Molnar <>
Cc: "Paul E. McKenney" <>,
	lkml <>,
	Davidlohr Bueso <>
Subject: [PATCH -tip] locking/mutex: Explicitly mark task as running after wakeup
Date: Mon, 19 Jan 2015 17:39:21 -0800	[thread overview]
Message-ID: <> (raw)

By the time we wake up and get the lock after being asleep
in the slowpath, we better be running. As good practice,
be explicit about this and avoid any mischief.

Signed-off-by: Davidlohr Bueso <>
 kernel/locking/mutex.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index c67a60b..5740706 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -587,6 +587,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 		spin_lock_mutex(&lock->wait_lock, flags);
+	__set_task_state(task, TASK_RUNNING);
 	mutex_remove_waiter(lock, &waiter, current_thread_info());
 	/* set it to 0 if there are no waiters left: */
 	if (likely(list_empty(&lock->wait_list)))

             reply	other threads:[~2015-01-20  1:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  1:39 Davidlohr Bueso [this message]
2015-02-04 14:37 ` [tip:locking/core] " tip-bot for Davidlohr Bueso

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:

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

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH -tip] locking/mutex: Explicitly mark task as running after wakeup' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).