<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/kernel/lockdep_internals.h, branch v2.6.30</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>lockdep: increase MAX_LOCKDEP_ENTRIES and MAX_LOCKDEP_CHAINS</title>
<updated>2009-05-12T17:59:52+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-05-12T14:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d80c19df5fcceb8c741e96f09f275c2da719efef'/>
<id>d80c19df5fcceb8c741e96f09f275c2da719efef</id>
<content type='text'>
Now that lockdep coverage has increased it has become easier to
run out of entries:

[   21.401387] BUG: MAX_LOCKDEP_ENTRIES too low!
[   21.402007] turning off the locking correctness validator.
[   21.402007] Pid: 1555, comm: S99local Not tainted 2.6.30-rc5-tip #2
[   21.402007] Call Trace:
[   21.402007]  [&lt;ffffffff81069789&gt;] add_lock_to_list+0x53/0xba
[   21.402007]  [&lt;ffffffff810eb615&gt;] ? lookup_mnt+0x19/0x53
[   21.402007]  [&lt;ffffffff8106be14&gt;] check_prev_add+0x14b/0x1c7
[   21.402007]  [&lt;ffffffff8106c304&gt;] validate_chain+0x474/0x52a
[   21.402007]  [&lt;ffffffff8106c6fc&gt;] __lock_acquire+0x342/0x3c7
[   21.402007]  [&lt;ffffffff8106c842&gt;] lock_acquire+0xc1/0xe5
[   21.402007]  [&lt;ffffffff810eb615&gt;] ? lookup_mnt+0x19/0x53
[   21.402007]  [&lt;ffffffff8153aedc&gt;] _spin_lock+0x31/0x66

Double the size - as we've done in the past.

[ Impact: allow lockdep to cover more locks ]

Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that lockdep coverage has increased it has become easier to
run out of entries:

[   21.401387] BUG: MAX_LOCKDEP_ENTRIES too low!
[   21.402007] turning off the locking correctness validator.
[   21.402007] Pid: 1555, comm: S99local Not tainted 2.6.30-rc5-tip #2
[   21.402007] Call Trace:
[   21.402007]  [&lt;ffffffff81069789&gt;] add_lock_to_list+0x53/0xba
[   21.402007]  [&lt;ffffffff810eb615&gt;] ? lookup_mnt+0x19/0x53
[   21.402007]  [&lt;ffffffff8106be14&gt;] check_prev_add+0x14b/0x1c7
[   21.402007]  [&lt;ffffffff8106c304&gt;] validate_chain+0x474/0x52a
[   21.402007]  [&lt;ffffffff8106c6fc&gt;] __lock_acquire+0x342/0x3c7
[   21.402007]  [&lt;ffffffff8106c842&gt;] lock_acquire+0xc1/0xe5
[   21.402007]  [&lt;ffffffff810eb615&gt;] ? lookup_mnt+0x19/0x53
[   21.402007]  [&lt;ffffffff8153aedc&gt;] _spin_lock+0x31/0x66

Double the size - as we've done in the past.

[ Impact: allow lockdep to cover more locks ]

Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: get_user_chars() redo</title>
<updated>2009-02-14T22:28:22+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-01-22T16:53:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f510b233cfc7bfd57b6007071c52aa42e3d16b06'/>
<id>f510b233cfc7bfd57b6007071c52aa42e3d16b06</id>
<content type='text'>
Generic, states independent, get_user_chars().

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generic, states independent, get_user_chars().

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: generate the state bit definitions</title>
<updated>2009-02-14T22:28:01+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-01-22T13:38:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d7b1b02134272840f4b655136e00c461e1cf1d53'/>
<id>d7b1b02134272840f4b655136e00c461e1cf1d53</id>
<content type='text'>
Generate the state bit definitions from the lockdep_states.h file.

Also, move LOCK_USED to last, so that the

 USED_IN
 USED_IN_READ
 ENABLED
 ENABLED_READ

states are nicely bit aligned -- we're going to use that property

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generate the state bit definitions from the lockdep_states.h file.

Also, move LOCK_USED to last, so that the

 USED_IN
 USED_IN_READ
 ENABLED
 ENABLED_READ

states are nicely bit aligned -- we're going to use that property

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: move state bit definitions around</title>
<updated>2009-02-14T22:27:59+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-01-22T13:18:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9851673bc32bc9fcafbbaeffc858ead434bd6d58'/>
<id>9851673bc32bc9fcafbbaeffc858ead434bd6d58</id>
<content type='text'>
For convenience later.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For convenience later.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: annotate reclaim context (__GFP_NOFS)</title>
<updated>2009-02-14T22:27:49+00:00</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@suse.de</email>
</author>
<published>2009-01-21T07:12:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cf40bd16fdad42c053040bcd3988f5fdedbb6c57'/>
<id>cf40bd16fdad42c053040bcd3988f5fdedbb6c57</id>
<content type='text'>
Here is another version, with the incremental patch rolled up, and
added reclaim context annotation to kswapd, and allocation tracing
to slab allocators (which may only ever reach the page allocator
in rare cases, so it is good to put annotations here too).

Haven't tested this version as such, but it should be getting closer
to merge worthy ;)

--
After noticing some code in mm/filemap.c accidentally perform a __GFP_FS
allocation when it should not have been, I thought it might be a good idea to
try to catch this kind of thing with lockdep.

I coded up a little idea that seems to work. Unfortunately the system has to
actually be in __GFP_FS page reclaim, then take the lock, before it will mark
it. But at least that might still be some orders of magnitude more common
(and more debuggable) than an actual deadlock condition, so we have some
improvement I hope (the concept is no less complete than discovery of a lock's
interrupt contexts).

I guess we could even do the same thing with __GFP_IO (normal reclaim), and
even GFP_NOIO locks too... but filesystems will have the most locks and fiddly
code paths, so let's start there and see how it goes.

It *seems* to work. I did a quick test.

=================================
[ INFO: inconsistent lock state ]
2.6.28-rc6-00007-ged31348-dirty #26
---------------------------------
inconsistent {in-reclaim-W} -&gt; {ov-reclaim-W} usage.
modprobe/8526 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (testlock){--..}, at: [&lt;ffffffffa0020055&gt;] brd_init+0x55/0x216 [brd]
{in-reclaim-W} state was registered at:
  [&lt;ffffffff80267bdb&gt;] __lock_acquire+0x75b/0x1a60
  [&lt;ffffffff80268f71&gt;] lock_acquire+0x91/0xc0
  [&lt;ffffffff8070f0e1&gt;] mutex_lock_nested+0xb1/0x310
  [&lt;ffffffffa002002b&gt;] brd_init+0x2b/0x216 [brd]
  [&lt;ffffffff8020903b&gt;] _stext+0x3b/0x170
  [&lt;ffffffff80272ebf&gt;] sys_init_module+0xaf/0x1e0
  [&lt;ffffffff8020c3fb&gt;] system_call_fastpath+0x16/0x1b
  [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
irq event stamp: 3929
hardirqs last  enabled at (3929): [&lt;ffffffff8070f2b5&gt;] mutex_lock_nested+0x285/0x310
hardirqs last disabled at (3928): [&lt;ffffffff8070f089&gt;] mutex_lock_nested+0x59/0x310
softirqs last  enabled at (3732): [&lt;ffffffff8061f623&gt;] sk_filter+0x83/0xe0
softirqs last disabled at (3730): [&lt;ffffffff8061f5b6&gt;] sk_filter+0x16/0xe0

other info that might help us debug this:
1 lock held by modprobe/8526:
 #0:  (testlock){--..}, at: [&lt;ffffffffa0020055&gt;] brd_init+0x55/0x216 [brd]

stack backtrace:
Pid: 8526, comm: modprobe Not tainted 2.6.28-rc6-00007-ged31348-dirty #26
Call Trace:
 [&lt;ffffffff80265483&gt;] print_usage_bug+0x193/0x1d0
 [&lt;ffffffff80266530&gt;] mark_lock+0xaf0/0xca0
 [&lt;ffffffff80266735&gt;] mark_held_locks+0x55/0xc0
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffff802667ca&gt;] trace_reclaim_fs+0x2a/0x60
 [&lt;ffffffff80285005&gt;] __alloc_pages_internal+0x475/0x580
 [&lt;ffffffff8070f29e&gt;] ? mutex_lock_nested+0x26e/0x310
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffffa002006a&gt;] brd_init+0x6a/0x216 [brd]
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffff8020903b&gt;] _stext+0x3b/0x170
 [&lt;ffffffff8070f8b9&gt;] ? mutex_unlock+0x9/0x10
 [&lt;ffffffff8070f83d&gt;] ? __mutex_unlock_slowpath+0x10d/0x180
 [&lt;ffffffff802669ec&gt;] ? trace_hardirqs_on_caller+0x12c/0x190
 [&lt;ffffffff80272ebf&gt;] sys_init_module+0xaf/0x1e0
 [&lt;ffffffff8020c3fb&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here is another version, with the incremental patch rolled up, and
added reclaim context annotation to kswapd, and allocation tracing
to slab allocators (which may only ever reach the page allocator
in rare cases, so it is good to put annotations here too).

Haven't tested this version as such, but it should be getting closer
to merge worthy ;)

--
After noticing some code in mm/filemap.c accidentally perform a __GFP_FS
allocation when it should not have been, I thought it might be a good idea to
try to catch this kind of thing with lockdep.

I coded up a little idea that seems to work. Unfortunately the system has to
actually be in __GFP_FS page reclaim, then take the lock, before it will mark
it. But at least that might still be some orders of magnitude more common
(and more debuggable) than an actual deadlock condition, so we have some
improvement I hope (the concept is no less complete than discovery of a lock's
interrupt contexts).

I guess we could even do the same thing with __GFP_IO (normal reclaim), and
even GFP_NOIO locks too... but filesystems will have the most locks and fiddly
code paths, so let's start there and see how it goes.

It *seems* to work. I did a quick test.

=================================
[ INFO: inconsistent lock state ]
2.6.28-rc6-00007-ged31348-dirty #26
---------------------------------
inconsistent {in-reclaim-W} -&gt; {ov-reclaim-W} usage.
modprobe/8526 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (testlock){--..}, at: [&lt;ffffffffa0020055&gt;] brd_init+0x55/0x216 [brd]
{in-reclaim-W} state was registered at:
  [&lt;ffffffff80267bdb&gt;] __lock_acquire+0x75b/0x1a60
  [&lt;ffffffff80268f71&gt;] lock_acquire+0x91/0xc0
  [&lt;ffffffff8070f0e1&gt;] mutex_lock_nested+0xb1/0x310
  [&lt;ffffffffa002002b&gt;] brd_init+0x2b/0x216 [brd]
  [&lt;ffffffff8020903b&gt;] _stext+0x3b/0x170
  [&lt;ffffffff80272ebf&gt;] sys_init_module+0xaf/0x1e0
  [&lt;ffffffff8020c3fb&gt;] system_call_fastpath+0x16/0x1b
  [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
irq event stamp: 3929
hardirqs last  enabled at (3929): [&lt;ffffffff8070f2b5&gt;] mutex_lock_nested+0x285/0x310
hardirqs last disabled at (3928): [&lt;ffffffff8070f089&gt;] mutex_lock_nested+0x59/0x310
softirqs last  enabled at (3732): [&lt;ffffffff8061f623&gt;] sk_filter+0x83/0xe0
softirqs last disabled at (3730): [&lt;ffffffff8061f5b6&gt;] sk_filter+0x16/0xe0

other info that might help us debug this:
1 lock held by modprobe/8526:
 #0:  (testlock){--..}, at: [&lt;ffffffffa0020055&gt;] brd_init+0x55/0x216 [brd]

stack backtrace:
Pid: 8526, comm: modprobe Not tainted 2.6.28-rc6-00007-ged31348-dirty #26
Call Trace:
 [&lt;ffffffff80265483&gt;] print_usage_bug+0x193/0x1d0
 [&lt;ffffffff80266530&gt;] mark_lock+0xaf0/0xca0
 [&lt;ffffffff80266735&gt;] mark_held_locks+0x55/0xc0
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffff802667ca&gt;] trace_reclaim_fs+0x2a/0x60
 [&lt;ffffffff80285005&gt;] __alloc_pages_internal+0x475/0x580
 [&lt;ffffffff8070f29e&gt;] ? mutex_lock_nested+0x26e/0x310
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffffa002006a&gt;] brd_init+0x6a/0x216 [brd]
 [&lt;ffffffffa0020000&gt;] ? brd_init+0x0/0x216 [brd]
 [&lt;ffffffff8020903b&gt;] _stext+0x3b/0x170
 [&lt;ffffffff8070f8b9&gt;] ? mutex_unlock+0x9/0x10
 [&lt;ffffffff8070f83d&gt;] ? __mutex_unlock_slowpath+0x10d/0x180
 [&lt;ffffffff802669ec&gt;] ? trace_hardirqs_on_caller+0x12c/0x190
 [&lt;ffffffff80272ebf&gt;] sys_init_module+0xaf/0x1e0
 [&lt;ffffffff8020c3fb&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: build fix</title>
<updated>2008-08-13T10:55:10+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-08-01T09:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d6672c501852d577097f6757c311d937aca0b04b'/>
<id>d6672c501852d577097f6757c311d937aca0b04b</id>
<content type='text'>
fix:

 kernel/built-in.o: In function `lockdep_stats_show':
 lockdep_proc.c:(.text+0x3cb2f): undefined reference to `lockdep_count_forward_deps'
 kernel/built-in.o: In function `l_show':
 lockdep_proc.c:(.text+0x3d02b): undefined reference to `lockdep_count_forward_deps'
 lockdep_proc.c:(.text+0x3d047): undefined reference to `lockdep_count_backward_deps'

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix:

 kernel/built-in.o: In function `lockdep_stats_show':
 lockdep_proc.c:(.text+0x3cb2f): undefined reference to `lockdep_count_forward_deps'
 kernel/built-in.o: In function `l_show':
 lockdep_proc.c:(.text+0x3d02b): undefined reference to `lockdep_count_forward_deps'
 lockdep_proc.c:(.text+0x3d047): undefined reference to `lockdep_count_backward_deps'

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: shrink held_lock structure</title>
<updated>2008-08-11T07:30:23+00:00</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2008-08-11T07:30:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f82b217e3513fe3af342c0f3ee1494e86250c21c'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: fix combinatorial explosion in lock subgraph traversal</title>
<updated>2008-07-31T16:38:28+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-07-30T04:45:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=419ca3f13532793b81aff09f80c60af3eacbb43d'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: add lock_class information to lock_chain and output it</title>
<updated>2008-06-23T23:28:20+00:00</updated>
<author>
<name>Huang, Ying</name>
<email>ying.huang@intel.com</email>
</author>
<published>2008-06-23T03:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cd1a28e8457e6ebf72c48d84d4e736307e86436e'/>
<id>cd1a28e8457e6ebf72c48d84d4e736307e86436e</id>
<content type='text'>
It is based on x86/master branch of git-x86 tree, and has been tested
on x86_64 platform.

ChangeLog:

v2:

- Enclosing proc file system related code into CONFIG_PROVE_LOCKING.

- Fix nr_chain_hlocks update code.

Signed-off-by: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is based on x86/master branch of git-x86 tree, and has been tested
on x86_64 platform.

ChangeLog:

v2:

- Enclosing proc file system related code into CONFIG_PROVE_LOCKING.

- Fix nr_chain_hlocks update code.

Signed-off-by: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: add lock_class information to lock_chain and output it</title>
<updated>2008-06-20T10:21:33+00:00</updated>
<author>
<name>Huang, Ying</name>
<email>ying.huang@intel.com</email>
</author>
<published>2008-06-20T08:39:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=443cd507ce7f78c6f8742b72736585c031d5a921'/>
<id>443cd507ce7f78c6f8742b72736585c031d5a921</id>
<content type='text'>
This patch records array of lock_class into lock_chain, and export
lock_chain information via /proc/lockdep_chains.

It is based on x86/master branch of git-x86 tree, and has been tested
on x86_64 platform.

Signed-off-by: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch records array of lock_class into lock_chain, and export
lock_chain information via /proc/lockdep_chains.

It is based on x86/master branch of git-x86 tree, and has been tested
on x86_64 platform.

Signed-off-by: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
</feed>
