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  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:   Tue, 7 May 2019 03:47:14 +0200
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Yuyang Du <duyuyang@...il.com>, will.deacon@....com,
        Ingo Molnar <mingo@...nel.org>,
        Bart Van Assche <bvanassche@....org>, ming.lei@...hat.com,
        tglx@...utronix.de, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 19/28] locking/lockdep: Optimize irq usage check when
 marking lock usage bit

On Tue, Apr 30, 2019 at 02:11:48PM +0200, Peter Zijlstra wrote:
> On Fri, Apr 26, 2019 at 02:57:37PM +0800, Yuyang Du wrote:
> > Thanks for review.
> > 
> > On Fri, 26 Apr 2019 at 03:32, Peter Zijlstra <peterz@...radead.org> wrote:
> > >
> > > On Wed, Apr 24, 2019 at 06:19:25PM +0800, Yuyang Du wrote:
> > >
> > > After only a quick read of these next patches; this is the one that
> > > worries me most.
> > >
> > > You did mention Frederic's patches, but I'm not entirely sure you're
> > > aware why he's doing them. He's preparing to split the softirq state
> > > into one state per softirq vector.
> > >
> > > See here:
> > >
> > >   https://lkml.kernel.org/r/20190228171242.32144-14-frederic@kernel.org
> > >   https://lkml.kernel.org/r/20190228171242.32144-15-frederic@kernel.org
> > >
> > > IOW he's going to massively explode this storage.
> > 
> > If I understand correctly, he is not going to.
> > 
> > First of all, we can divide the whole usage thing into tracking and checking.
> > 
> > Frederic's fine-grained soft vector state is applied to usage
> > tracking, i.e., which specific vectors a lock is used or enabled.
> > 
> > But for usage checking, which vectors are does not really matter. So,
> > the current size of the arrays and bitmaps are good enough. Right?
> 
> Frederic? My understanding was that he really was going to split the
> whole thing. The moment you allow masking individual soft vectors, you
> get per-vector dependency chains.

Right, so in my patchset there is indeed individual soft vectors masked
so we indeed need per vector checks. For example a lock taken in HRTIMER
softirq shouldn't be a problem if it is concurrently taken while BLOCK softirq
is enabled. And for that we expand the usage_mask so that the 4 bits currently
used for general SOFTIRQ are now multiplied by NR_SOFTIRQ (10) because we need to
track the USED and ENABLED_IN bits for each of them.

The end result is:

4 hard irq bits + 4 * 10 softirq bits + LOCK_USED bit = 45 bits.

Not sure that answers the question as I'm a bit lost in the debate...

Powered by blists - more mailing lists