mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: correct testing need_resched in mutex_spin_on_owner()
@ 2011-06-07 13:41 Hillf Danton
  2011-06-07 13:47 ` Peter Zijlstra
  0 siblings, 1 reply; 15+ messages in thread
From: Hillf Danton @ 2011-06-07 13:41 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Peter Zijlstra

It is suppose to check the owner task that is not absolutly running on the
local CPU, and if NEED_RESCHED is happenly set on the current task of local
CPU, we get incorrect result.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index fd18f39..3ea64fe 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4326,7 +4326,7 @@ int mutex_spin_on_owner(struct mutex *lock,
struct task_struct *owner)
 		return 0;

 	while (owner_running(lock, owner)) {
-		if (need_resched())
+		if (test_tsk_need_resched(owner))
 			return 0;

 		arch_mutex_cpu_relax();

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

end of thread, other threads:[~2011-06-07 18:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 13:41 [PATCH] sched: correct testing need_resched in mutex_spin_on_owner() Hillf Danton
2011-06-07 13:47 ` Peter Zijlstra
2011-06-07 13:50   ` Peter Zijlstra
2011-06-07 13:59   ` Peter Zijlstra
2011-06-07 14:14     ` Hillf Danton
2011-06-07 14:10   ` Hillf Danton
2011-06-07 14:24     ` Peter Zijlstra
2011-06-07 14:36       ` Hillf Danton
2011-06-07 14:40         ` Peter Zijlstra
2011-06-07 14:47           ` Hillf Danton
2011-06-07 15:08             ` Steven Rostedt
2011-06-07 18:22               ` Hillf Danton
2011-06-07 18:34                 ` Steven Rostedt
2011-06-07 15:20             ` Peter Zijlstra
2011-06-07 15:43               ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome