Re: [PATCH][RFC]: mutex: adaptive spin

From: Pavel Machek
Date: Sat Jan 10 2009 - 12:53:13 EST



> Linus, what do you think about this particular approach of spin-mutexes?
> It's not the typical spin-mutex i think.
>
> The thing i like most about Peter's patch (compared to most other adaptive
> spinning approaches i've seen, which all sucked as they included various
> ugly heuristics complicating the whole thing) is that it solves the "how
> long should we spin" question elegantly: we spin until the owner runs on a
> CPU.

Well; if there's a timeout, that's obviously safe.

But this has no timeout, and Linus wants to play games with accessing
'does owner run on cpu?' lockless. Now, can it mistakenly spin when
the owner is scheduled away? That would deadlock, and without locking,
I'm not sure if we prevent that....

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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/