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] [day] [month] [year] [list]
Date:   Tue, 11 Sep 2018 16:04:11 +0100
From:   Dmitry Safonov <dima@...sta.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Daniel Axtens <dja@...ens.net>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Michael Neuling <mikey@...ling.org>,
        Mikulas Patocka <mpatocka@...hat.com>,
        Nathan March <nathan@...net>,
        Pasi Kärkkäinen <pasik@....fi>,
        Peter Hurley <peter@...leysoftware.com>,
        "Rong, Chen" <rong.a.chen@...el.com>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Tan Xiaojun <tanxiaojun@...wei.com>,
        Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>
Subject: Re: [PATCHv3 6/6] tty/ldsem: Decrement wait_readers on timeouted
 down_read()

On Tue, 2018-09-11 at 15:50 +0200, Peter Zijlstra wrote:
> On Tue, Sep 11, 2018 at 02:33:22PM +0100, Dmitry Safonov wrote:
> > > > You might want to think about ditching that ldsem thing
> > > > entirely,
> > > > and use a regular rwsem ?
> > > 
> > > Yeah, but AFAICS, regular rwsem will need to have a timeout then
> > > (for
> > > write). So, I thought fixing this pile would be simpler than
> > > adding
> > > timeout and probably writer-priority to generic rwsem?
> > > 
> > > And I guess, we still will need fixes for stable for the bugs
> > > here..
> > > 
> > > I expect that timeouts are ABI, while the gain of adding priority
> > > may
> > > be measured. I'll give it a shot (adding timeout/priority for
> > > linux-
> > > next) to rwsem if you say it's acceptable.
> > 
> > Actually, priority looks quite simple: we can add writers in the
> > head
> > of wait_list and it probably may work.
> > Timeout looks also not a rocket science.
> > So, I can try to do that if you say it's acceptable (with the gain
> > measures).
> 
> So why do you need writer priority? The comment that goes with ldsems
> doesn't explain I think, it just says it has it.

Well, as far as I can fetch from the  commit 4898e640caf0, it describes
that you should halt and scrap pending i/o (reader side) to prevent the
loss or change of the current line dicipline (write lock).
So, AFAIU, line discipline is expected to change within 5 sec by ABI
and write-priority makes it more likely.

> In general I dislike unfair locks, they always cause trouble.
> 
> > After this can of worms that I need to fix regardless.
> 
> Sure.

-- 
Thanks,
             Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ