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]
Message-ID: <20170725154136.hu3f2mjfunkyidnd@hirez.programming.kicks-ass.net>
Date:   Tue, 25 Jul 2017 17:41:36 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Byungchul Park <byungchul.park@....com>
Cc:     mingo@...nel.org, tglx@...utronix.de, walken@...gle.com,
        boqun.feng@...il.com, kirill@...temov.name,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, willy@...radead.org, npiggin@...il.com,
        kernel-team@....com
Subject: Re: [PATCH v7 08/16] lockdep: Avoid adding redundant direct links of
 crosslocks

On Wed, May 24, 2017 at 05:59:41PM +0900, Byungchul Park wrote:
> We can skip adding a dependency 'AX -> B', in case that we ensure 'AX ->
> the previous of B in hlocks' to be created, where AX is a crosslock and
> B is a typical lock. Remember that two adjacent locks in hlocks generate
> a dependency like 'prev -> next', that is, 'the previous of B in hlocks
> -> B' in this case.
> 
> For example:
> 
>              in hlocks[]
>              ------------
>           ^  A (gen_id: 4) --+
>           |                  | previous gen_id
>           |  B (gen_id: 3) <-+
>           |  C (gen_id: 3)
>           |  D (gen_id: 2)
>    oldest |  E (gen_id: 1)
> 
>              in xhlocks[]
>              ------------
>           ^  A (gen_id: 4, prev_gen_id: 3(B's gen id))
>           |  B (gen_id: 3, prev_gen_id: 3(C's gen id))
>           |  C (gen_id: 3, prev_gen_id: 2(D's gen id))
>           |  D (gen_id: 2, prev_gen_id: 1(E's gen id))
>    oldest |  E (gen_id: 1, prev_gen_id: NA)
> 
> On commit for a crosslock AX(gen_id = 3), it's engough to add 'AX -> C',
> but adding 'AX -> B' and 'AX -> A' is unnecessary since 'AX -> C', 'C ->
> B' and 'B -> A' cover them, which are guaranteed to be generated.
> 
> This patch intoduces a variable, prev_gen_id, to avoid adding this kind
> of redundant dependencies. In other words, the previous in hlocks will
> anyway handle it if the previous's gen_id >= the crosslock's gen_id.
> 

Didn't we talk about an alternative to this?

/me goes dig

 https://lkml.kernel.org/r/20170303091338.GH6536@twins.programming.kicks-ass.net

There and replies.

So how much does this save vs avoiding redundant links?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ