[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTimZ8=YYZXZSzauy5ASsP0kwti8uxQ@mail.gmail.com>
Date: Tue, 7 Jun 2011 21:41:03 +0800
From: Hillf Danton <dhillf@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Ingo Molnar <mingo@...e.hu>, Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH] sched: correct testing need_resched in mutex_spin_on_owner()
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@...il.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();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists