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: <6879cb32-1d6e-79bd-04c2-8f7c09c48bfe@redhat.com>
Date:   Thu, 22 Nov 2018 15:17:52 -0500
From:   Waiman Long <longman@...hat.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Will Deacon <will.deacon@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, kasan-dev@...glegroups.com,
        linux-mm@...ck.org, iommu@...ts.linux-foundation.org,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Tejun Heo <tj@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 09/17] debugobjects: Make object hash locks nestable
 terminal locks

On 11/22/2018 10:33 AM, Petr Mladek wrote:
> On Mon 2018-11-19 13:55:18, Waiman Long wrote:
>> By making the object hash locks nestable terminal locks, we can avoid
>> a bunch of unnecessary lockdep validations as well as saving space
>> in the lockdep tables.
> Please, explain which terminal lock might be nested.
>
> Hmm, it would hide eventual nesting of other terminal locks.
> It might reduce lockdep reliability. I wonder if the space
> optimization is worth it.
>
> Finally, it might be good to add a short explanation what (nested)
> terminal locks mean into each commit. It would help people to
> understand the effect without digging into the lockdep code, ...
>
> Best Regards,
> Petr

Nested terminal lock is currently only used in the debugobjects code. It
should only be used on a case-by-case basis. In the case of the
debugojects code, the locking patterns are:

(1)

raw_spin_lock(&db_lock);
...
raw_spin_unlock(&db_lock);

(2)

raw_spin_lock(&db_lock);
...
raw_spin_lock(&pool_lock);
...
raw_spin_unlock(&pool_lock);
...
raw_spin_unlock(&db_lock);

(3)

raw_spin_lock(&pool_lock);
...
raw_spin_unlock(&pool_lock);

So the db_lock is made to be nestable that it can allow acquisition of
pool_lock (a regular terminal lock) underneath it.

Cheers,
Longman


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ