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: <c2e2ce9b-d04b-9f05-8fc6-11fa5b659b52@redhat.com>
Date:   Fri, 3 May 2019 11:26:19 -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-tip v7 12/20] locking/rwsem: Clarify usage of owner's
 nonspinaable bit

On 5/3/19 11:21 AM, Peter Zijlstra wrote:
> On Sun, Apr 28, 2019 at 05:25:49PM -0400, Waiman Long wrote:
>> Bit 1 of sem->owner (RWSEM_ANONYMOUSLY_OWNED) is used to designate an
>> anonymous owner - readers or an anonymous writer. The setting of this
>> anonymous bit is used as an indicator that optimistic spinning cannot
>> be done on this rwsem.
>>
>> With the upcoming reader optimistic spinning patches, a reader-owned
>> rwsem can be spinned on for a limit period of time. We still need
>> this bit to indicate a rwsem is nonspinnable, but not setting this
>> bit loses its meaning that the owner is known. So rename the bit
>> to RWSEM_NONSPINNABLE to clarify its meaning.
>>
>> This patch also fixes a DEBUG_RWSEMS_WARN_ON() bug in __up_write().
>>
>> Signed-off-by: Waiman Long <longman@...hat.com>
>> ---
>>  include/linux/rwsem.h  |  2 +-
>>  kernel/locking/rwsem.c | 43 +++++++++++++++++++++---------------------
>>  2 files changed, 22 insertions(+), 23 deletions(-)
>>
>> diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
>> index 148983e21d47..bb76e82398b2 100644
>> --- a/include/linux/rwsem.h
>> +++ b/include/linux/rwsem.h
>> @@ -50,7 +50,7 @@ struct rw_semaphore {
>>  };
>>  
>>  /*
>> - * Setting bit 1 of the owner field but not bit 0 will indicate
>> + * Setting all bits of the owner field except bit 0 will indicate
>>   * that the rwsem is writer-owned with an unknown owner.
>>   */
>>  #define RWSEM_OWNER_UNKNOWN	((struct task_struct *)-2L)
> As you know, I'm trying to kill that :-)

I am planning to remove it once your patch is merged.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ