[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1307460040.2322.279.camel@twins>
Date: Tue, 07 Jun 2011 17:20:40 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Hillf Danton <dhillf@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH] sched: correct testing need_resched in
mutex_spin_on_owner()
On Tue, 2011-06-07 at 22:47 +0800, Hillf Danton wrote:
> Oh, it looks you are willing to rethink about testing need_resched?
Dude, however did you come up with that deduction?
mutex_spin_on_owner() does two things:
- it validates that owner is in fact still running (if so it must be on
another cpu, since we're running on this one).
- it ensures we play nice and reschedule when we need to, so we don't
hog our cpu.
Testing TIF_NEED_RESCHED on owner like you propose is wrong because:
- owner is not a stable pointer you can dereference, see
owner_running(), you first need to validate that its still a valid
pointer and then keep it valid while dereferencing it.
- if owner were to reschedule, it would leave the cpu and we'd break
out of the loop anyway by means of owner_running() failing, so its
superfluous.
Please, get a grip on reality and stop sending endless streams of
patches based on wrong assumptions and mis-understandings.
--
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