Re: [PATCH] sched: correct testing need_resched inmutex_spin_on_owner()
From: Steven Rostedt
Date: Tue Jun 07 2011 - 14:34:51 EST
On Wed, 2011-06-08 at 02:22 +0800, Hillf Danton wrote:
> After hours chewing __mutex_lock_common() and mutex_spin_on_owner(),
> and what you and Peter said, the owner is on different CPU from the waiter,
> and the patched need_resched is simply meaning the waiter is no longer
> willing to wait for whatever reasons.
>
> It is really unlucky tonight:(
Please don't get discouraged.
We just want you to spend a bit more time looking at the code. Do what I
do when something looks wrong. Try to figure out what the author was
doing and why it may actually be correct. You may find out that the code
is indeed correct.
When I see code that looks wrong, I first think my assumptions are
incorrect, and I try to prove myself wrong. Only when I fail to do that,
do I send a patch or bring it up to the author. And then, I do it in
such a way that the author of the code may still have the ability to
prove me wrong. And several times, an author will tell me something that
I overlooked, and the original code stays as is.
Don't take it personally, this is just a learning phase. ;)
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/