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: <20201208100704.GU2414@hirez.programming.kicks-ass.net>
Date:   Tue, 8 Dec 2020 11:07:04 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
        linux-kernel@...r.kernel.org, Davidlohr Bueso <dave@...olabs.net>,
        Phil Auld <pauld@...hat.com>
Subject: Re: [PATCH v2 5/5] locking/rwsem: Remove reader optimistic spinning

On Fri, Nov 20, 2020 at 11:14:16PM -0500, Waiman Long wrote:


> @@ -1032,40 +901,16 @@ rwsem_down_read_slowpath(struct rw_semaphore *sem, int state, long count)
>  	 *
>  	 * We can take the read lock directly without doing
>  	 * rwsem_optimistic_spin() if the conditions are right.

This comment no longer makes sense..

> -	 * Also wake up other readers if it is the first reader.
>  	 */
> -	if (!(count & (RWSEM_WRITER_LOCKED | RWSEM_FLAG_HANDOFF)) &&
> -	    rwsem_no_spinners(sem)) {
> +	if (!(count & (RWSEM_WRITER_LOCKED | RWSEM_FLAG_HANDOFF))) {
>  		rwsem_set_reader_owned(sem);
>  		lockevent_inc(rwsem_rlock_steal);
> -		if (rcnt == 1)
> -			goto wake_readers;
> -		return sem;
> -	}
>  
> -	/*
> -	 * Save the current read-owner of rwsem, if available, and the
> -	 * reader nonspinnable bit.
> -	 */
> -	waiter.last_rowner = owner;
> -	if (!(waiter.last_rowner & RWSEM_READER_OWNED))
> -		waiter.last_rowner &= RWSEM_RD_NONSPINNABLE;
> -
> -	if (!rwsem_can_spin_on_owner(sem, RWSEM_RD_NONSPINNABLE))
> -		goto queue;
> -
> -	/*
> -	 * Undo read bias from down_read() and do optimistic spinning.
> -	 */
> -	atomic_long_add(-RWSEM_READER_BIAS, &sem->count);
> -	adjustment = 0;
> -	if (rwsem_optimistic_spin(sem, false)) {

since we're removing the optimistic spinning entirely on the read side.

Also, I was looking at skipping patch #4, which mucks with the reader
wakeup logic, and afaict this removal doesn't really depend on it.

Or am I missing something?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ