[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH -v5][RFC]: mutex: implement adaptive spinning

On Wed, 7 Jan 2009, Peter Zijlstra wrote:
> Do we really have to re-do all that code every loop?

No, you're right, we can just look up the cpu once. Which makes Andrew's
argument that "probe_kernel_address()" isn't in any hot path even more

> Also, it would still need to do the funny:
> l_owner = ACCESS_ONCE(lock->owner)
> if (l_owner && l_owner != thread)
> break;

Why? That would fall out of the

if (lock->owner != thread)

part. We don't actually care that it only happens once: this all has
_known_ races, and the "cpu_relax()" is a barrier.

And notice how the _caller_ handles the "owner == NULL" case by not even
calling this, and looping over just the state in the lock itself. That was
in the earlier emails. So this approach is actually pretty different from
the case that depended on the whole spinlock thing.


 \ /
  Last update: 2009-01-07 23:03    [W:0.305 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site