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]
Date:   Wed, 30 Oct 2019 19:47:23 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Will Deacon <will.deacon@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, bigeasy@...utronix.de,
        juri.lelli@...hat.com, williams@...hat.com, bristot@...hat.com,
        longman@...hat.com, dave@...olabs.net, jack@...e.com
Subject: Re: [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem

On Wed, Oct 30, 2019 at 06:52:31PM +0100, Peter Zijlstra wrote:
> On Tue, Oct 29, 2019 at 07:47:39PM +0100, Peter Zijlstra wrote:
> > I've made these changes. Now let me go have a play with that second
> > waitqueue.
> 
> What I've ended up with is a 'custom' waitqueue and an rcuwait. The
> rcuwait conveniently got around the tedious preempt_enable/disable
> around the __percpu_up_read() wakeup.
> 
> I realized that up_read will only ever have to wake a (single) blocked
> writer, never a series of readers.
> 
> Compile tested only, I'll build and boot test once i've had dinner.

It seems to boot and build a kernel, it must be perfect ;-)

I think I'll go split this into a number of smaller patches:

 - move lockdep_map into percpu_rwsem and stop using the rwsem one
 - use bool
 - move the __this_cpu_{inc,dec} into the slowpath
 - rework __percpu_down_read() as per your earlier suggestion
 - replace rwsem with wait_queue + atomic_t

that might help make all this slightly easier to read.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ