lkml.org 
[lkml]   [2019]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 17/19] locking/rwsem: Merge owner into count on x86-64
On Tue, Jun 04, 2019 at 11:47:21AM -0400, Waiman Long wrote:
> On 6/4/19 5:45 AM, Peter Zijlstra wrote:
> > On Mon, May 20, 2019 at 04:59:16PM -0400, Waiman Long wrote:
> >> With separate count and owner, there are timing windows where the two
> >> values are inconsistent. That can cause problem when trying to figure
> >> out the exact state of the rwsem. For instance, a RT task will stop
> >> optimistic spinning if the lock is acquired by a writer but the owner
> >> field isn't set yet. That can be solved by combining the count and
> >> owner together in a single atomic value.
> > I just realized we can use cmpxchg_double() here (where available of
> > course).
>
> Does the 2 doubles need to be 128-bit aligned to use cmpxchg_double()? I
> don't think we can guarantee that unless we explicitly set this alignment.

It does :/ and yes, we'd need to play games with __align(2*sizeof(long))
and such.

\
 
 \ /
  Last update: 2019-06-04 19:03    [W:0.076 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site