From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934158AbbBDOiK (ORCPT ); Wed, 4 Feb 2015 09:38:10 -0500 Received: from terminus.zytor.com ([198.137.202.10]:38805 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934137AbbBDOiF (ORCPT ); Wed, 4 Feb 2015 09:38:05 -0500 Date: Wed, 4 Feb 2015 06:37:26 -0800 From: tip-bot for Davidlohr Bueso Message-ID: Cc: mingo@kernel.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, dave@stgolabs.net, dbueso@suse.de, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org Reply-To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, dbueso@suse.de, paulmck@linux.vnet.ibm.com, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, dave@stgolabs.net, tglx@linutronix.de In-Reply-To: <1421717961.4903.11.camel@stgolabs.net> References: <1421717961.4903.11.camel@stgolabs.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/mutex: Explicitly mark task as running after wakeup Git-Commit-ID: 51587bcf31d070119d37de6103543c807f5ccdb3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 51587bcf31d070119d37de6103543c807f5ccdb3 Gitweb: http://git.kernel.org/tip/51587bcf31d070119d37de6103543c807f5ccdb3 Author: Davidlohr Bueso AuthorDate: Mon, 19 Jan 2015 17:39:21 -0800 Committer: Ingo Molnar CommitDate: Wed, 4 Feb 2015 07:57:33 +0100 locking/mutex: Explicitly mark task as running after wakeup 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 Signed-off-by: Peter Zijlstra (Intel) Cc: "Paul E. McKenney" Cc: Linus Torvalds Link: http://lkml.kernel.org/r/1421717961.4903.11.camel@stgolabs.net Signed-off-by: Ingo Molnar --- 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, schedule_preempt_disabled(); 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)))