lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28a6c7b5-c40e-1c89-03e2-688c1135f3b5@redhat.com>
Date:   Tue, 4 Jun 2019 13:06:11 -0400
From:   Waiman Long <longman@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>, Will Deacon <will.deacon@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
        x86@...nel.org, Davidlohr Bueso <dave@...olabs.net>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        huang ying <huang.ying.caritas@...il.com>
Subject: Re: [PATCH v8 17/19] locking/rwsem: Merge owner into count on x86-64

On 6/4/19 1:02 PM, Peter Zijlstra wrote:
> 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.

So do you want this as an option now as it will be x86 specific? Or we
can do that as a follow-up if we want to.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ