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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191217103547.GC2844@hirez.programming.kicks-ass.net>
Date:   Tue, 17 Dec 2019 11:35:47 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Davidlohr Bueso <dave@...olabs.net>
Cc:     mingo@...nel.org, will@...nel.org, oleg@...hat.com,
        tglx@...utronix.de, linux-kernel@...r.kernel.org,
        bigeasy@...utronix.de, juri.lelli@...hat.com, williams@...hat.com,
        bristot@...hat.com, longman@...hat.com, jack@...e.com
Subject: Re: [PATCH 5/5] locking/percpu-rwsem: Remove the embedded rwsem

On Mon, Nov 18, 2019 at 11:53:04AM -0800, Davidlohr Bueso wrote:
> On Wed, 13 Nov 2019, Peter Zijlstra wrote:
> > @@ -54,23 +52,23 @@ static bool __percpu_down_read_trylock(s
> > 	 * the same CPU as the increment, avoiding the
> > 	 * increment-on-one-CPU-and-decrement-on-another problem.
> 
> Nit: Now that you've made read_count more symmetric, maybe this first
> paragraph can be moved down to __percpu_rwsem_trylock() reader side,
> as such:
> 
> 	/*
> 	 * Due to having preemption disabled the decrement happens on
> 	 * the same CPU as the increment, avoiding the
> 	 * increment-on-one-CPU-and-decrement-on-another problem.
> 	 */
> 	preempt_disable();
> 	ret = __percpu_down_read_trylock(sem);
> 	preempt_enable();

There's another callsite for that function too, so I think the current
place still works best.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ