<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/lockdep.h, branch v2.6.27.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.27.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v2.6.27.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2008-08-11T13:25:07Z</updated>
<entry>
<title>lockdep: increase MAX_LOCKDEP_KEYS</title>
<updated>2008-08-11T13:25:07Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-08-11T10:37:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e5f363e358cf16e4ad13a6826e15088c5495efe9'/>
<id>urn:sha1:e5f363e358cf16e4ad13a6826e15088c5495efe9</id>
<content type='text'>
certain configs produce:

 [   70.076229] BUG: MAX_LOCKDEP_KEYS too low!
 [   70.080230] turning off the locking correctness validator.

tune them up.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: fix overflow in the hlock shrinkage code</title>
<updated>2008-08-11T10:34:42Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-11T10:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b42e737e576339c795d9ac77a1fce6057f6bc0cf'/>
<id>urn:sha1:b42e737e576339c795d9ac77a1fce6057f6bc0cf</id>
<content type='text'>
There is a overflow by 1 case in the new shrunken hlock code.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: rename map_[acquire|release]() =&gt; lock_map_[acquire|release]()</title>
<updated>2008-08-11T08:30:30Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-08-11T08:30:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3295f0ef9ff048a4619ede597ad9ec9cab725654'/>
<id>urn:sha1:3295f0ef9ff048a4619ede597ad9ec9cab725654</id>
<content type='text'>
the names were too generic:

 drivers/uio/uio.c:87: error: expected identifier or '(' before 'do'
 drivers/uio/uio.c:87: error: expected identifier or '(' before 'while'
 drivers/uio/uio.c:113: error: 'map_release' undeclared here (not in a function)

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: spin_lock_nest_lock()</title>
<updated>2008-08-11T07:30:24Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-11T07:30:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b7d39aff91454f2534db2275f55908656ec0470c'/>
<id>urn:sha1:b7d39aff91454f2534db2275f55908656ec0470c</id>
<content type='text'>
Expose the new lock protection lock.

This can be used to annotate places where we take multiple locks of the
same class and avoid deadlocks by always taking another (top-level) lock
first.

NOTE: we're still bound to the MAX_LOCK_DEPTH (48) limit.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: lock protection locks</title>
<updated>2008-08-11T07:30:24Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-11T07:30:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7531e2f34d1d551b096143f19111139f0dd84c8b'/>
<id>urn:sha1:7531e2f34d1d551b096143f19111139f0dd84c8b</id>
<content type='text'>
On Fri, 2008-08-01 at 16:26 -0700, Linus Torvalds wrote:

&gt; On Fri, 1 Aug 2008, David Miller wrote:
&gt; &gt;
&gt; &gt; Taking more than a few locks of the same class at once is bad
&gt; &gt; news and it's better to find an alternative method.
&gt;
&gt; It's not always wrong.
&gt;
&gt; If you can guarantee that anybody that takes more than one lock of a
&gt; particular class will always take a single top-level lock _first_, then
&gt; that's all good. You can obviously screw up and take the same lock _twice_
&gt; (which will deadlock), but at least you cannot get into ABBA situations.
&gt;
&gt; So maybe the right thing to do is to just teach lockdep about "lock
&gt; protection locks". That would have solved the multi-queue issues for
&gt; networking too - all the actual network drivers would still have taken
&gt; just their single queue lock, but the one case that needs to take all of
&gt; them would have taken a separate top-level lock first.
&gt;
&gt; Never mind that the multi-queue locks were always taken in the same order:
&gt; it's never wrong to just have some top-level serialization, and anybody
&gt; who needs to take &lt;n&gt; locks might as well do &lt;n+1&gt;, because they sure as
&gt; hell aren't going to be on _any_ fastpaths.
&gt;
&gt; So the simplest solution really sounds like just teaching lockdep about
&gt; that one special case. It's not "nesting" exactly, although it's obviously
&gt; related to it.

Do as Linus suggested. The lock protection lock is called nest_lock.

Note that we still have the MAX_LOCK_DEPTH (48) limit to consider, so anything
that spills that it still up shit creek.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: map_acquire</title>
<updated>2008-08-11T07:30:23Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-11T07:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f3e7524b2e703d9f8b02ac338153a53dd7ede66'/>
<id>urn:sha1:4f3e7524b2e703d9f8b02ac338153a53dd7ede66</id>
<content type='text'>
Most the free-standing lock_acquire() usages look remarkably similar, sweep
them into a new helper.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: shrink held_lock structure</title>
<updated>2008-08-11T07:30:23Z</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2008-08-11T07:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f82b217e3513fe3af342c0f3ee1494e86250c21c'/>
<id>urn:sha1:f82b217e3513fe3af342c0f3ee1494e86250c21c</id>
<content type='text'>
struct held_lock {
        u64                        prev_chain_key;       /*     0     8 */
        struct lock_class *        class;                /*     8     8 */
        long unsigned int          acquire_ip;           /*    16     8 */
        struct lockdep_map *       instance;             /*    24     8 */
        int                        irq_context;          /*    32     4 */
        int                        trylock;              /*    36     4 */
        int                        read;                 /*    40     4 */
        int                        check;                /*    44     4 */
        int                        hardirqs_off;         /*    48     4 */

        /* size: 56, cachelines: 1 */
        /* padding: 4 */
        /* last cacheline: 56 bytes */
};

struct held_lock {
        u64                        prev_chain_key;       /*     0     8 */
        long unsigned int          acquire_ip;           /*     8     8 */
        struct lockdep_map *       instance;             /*    16     8 */
        unsigned int               class_idx:11;         /*    24:21  4 */
        unsigned int               irq_context:2;        /*    24:19  4 */
        unsigned int               trylock:1;            /*    24:18  4 */
        unsigned int               read:2;               /*    24:16  4 */
        unsigned int               check:2;              /*    24:14  4 */
        unsigned int               hardirqs_off:1;       /*    24:13  4 */

        /* size: 32, cachelines: 1 */
        /* padding: 4 */
        /* bit_padding: 13 bits */
        /* last cacheline: 32 bytes */
};

[mingo@elte.hu: shrunk hlock-&gt;class too]
[peterz@infradead.org: fixup bit sizes]
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
</content>
</entry>
<entry>
<title>lockdep: lock_set_subclass - reset a held lock's subclass</title>
<updated>2008-08-11T07:30:21Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-11T07:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=64aa348edc617dea17bbd01ddee4e47886d5ec8c'/>
<id>urn:sha1:64aa348edc617dea17bbd01ddee4e47886d5ec8c</id>
<content type='text'>
this can be used to reset a held lock's subclass, for arbitrary-depth
iterated data structures such as trees or lists which have per-node
locks.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: fix combinatorial explosion in lock subgraph traversal</title>
<updated>2008-07-31T16:38:28Z</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-07-30T04:45:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=419ca3f13532793b81aff09f80c60af3eacbb43d'/>
<id>urn:sha1:419ca3f13532793b81aff09f80c60af3eacbb43d</id>
<content type='text'>
When we traverse the graph, either forwards or backwards, we
are interested in whether a certain property exists somewhere
in a node reachable in the graph.

Therefore it is never necessary to traverse through a node more
than once to get a correct answer to the given query.

Take advantage of this property using a global ID counter so that we
need not clear all the markers in all the lock_class entries before
doing a traversal.  A new ID is choosen when we start to traverse, and
we continue through a lock_class only if it's ID hasn't been marked
with the new value yet.

This short-circuiting is essential especially for high CPU count
systems.  The scheduler has a runqueue per cpu, and needs to take
two runqueue locks at a time, which leads to long chains of
backwards and forwards subgraphs from these runqueue lock nodes.
Without the short-circuit implemented here, a graph traversal on
a runqueue lock can take up to (1 &lt;&lt; (N - 1)) checks on a system
with N cpus.

For anything more than 16 cpus or so, lockdep will eventually bring
the machine to a complete standstill.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lockdep: remove duplicate definition of STATIC_LOCKDEP_MAP_INIT</title>
<updated>2008-06-24T11:43:07Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2008-06-23T02:52:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a033c332e047397904ed74816946b2edd9b0d5cd'/>
<id>urn:sha1:a033c332e047397904ed74816946b2edd9b0d5cd</id>
<content type='text'>
STATIC_LOCKDEP_MAP_INIT is defined twice in lockdep.h. I guess
it's a copy &amp; paste.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
