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, 23 May 2018 10:19:34 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     psodagud@...eaurora.org, Kees Cook <keescook@...omium.org>,
        Andy Lutomirski <luto@...capital.net>,
        Will Drewry <wad@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Rik van Riel <riel@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        Eric Biggers <ebiggers@...gle.com>,
        Frederic Weisbecker <fweisbec@...il.com>, sherryy@...roid.com,
        Vegard Nossum <vegard.nossum@...cle.com>,
        Christoph Lameter <cl@...ux.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Sasha Levin <alexander.levin@...izon.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: write_lock_irq(&tasklist_lock)

On Tue, May 22, 2018 at 02:31:42PM -0700, Linus Torvalds wrote:
> On Tue, May 22, 2018 at 2:17 PM Peter Zijlstra <peterz@...radead.org> wrote:
> 
> > qrwlock is a fair lock and should not exhibit writer starvation.
> 
> We actually have a special rule to make it *not* be fair, in that
> interrupts are allowed to take the read lock if there are readers - even if
> there are waiting writers.

Urgh, right.. would be interesting to know how much of that is happening
in that workload. I assumed the readers were mostly due to the syscalls
the reporter talked about, and those should not trigger that case.

> > You basically want to spin-wait with interrupts enabled, right?
> 
> That was the intent of my (untested) pseudo-code. It should work fine. Note
> that I used write_trylock() only, so there is no queueing (which also
> implies no fairness).
> 
> I'm not saying it's a _good_ idea.  I'm saying it might work if all you
> worry about is the irq-disabled part.

Right, if you make it unfair and utterly prone to starvation then yes,
you can make it 'work'.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ