lkml.org 
[lkml]   [2011]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched: correct testing need_resched in mutex_spin_on_owner()
From
Date
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.




\
 
 \ /
  Last update: 2011-06-07 17:23    [W:0.404 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site