<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/lockdep.c, branch v2.6.23</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.23</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.23'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2007-07-19T17:04:49Z</updated>
<entry>
<title>lockdep debugging: give stacktrace for init_error</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes@sipsolutions.net</email>
</author>
<published>2007-07-19T08:49:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c71063c9c9dc232d0d51f936f237f7dc5681e8e3'/>
<id>urn:sha1:c71063c9c9dc232d0d51f936f237f7dc5681e8e3</id>
<content type='text'>
When I started adding support for lockdep to 64-bit powerpc, I got a
lockdep_init_error and with this patch was able to pinpoint why and where
to put lockdep_init().  Let's support this generally for others adding
lockdep support to their architecture.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockstat: measure lock bouncing</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:49:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=96645678cd726e87ce42a0664de71e047e32bca4'/>
<id>urn:sha1:96645678cd726e87ce42a0664de71e047e32bca4</id>
<content type='text'>
    __acquire
        |
       lock _____
        |        \
        |    __contended
        |         |
        |        wait
        | _______/
        |/
        |
   __acquired
        |
   __release
        |
     unlock

We measure acquisition and contention bouncing.

This is done by recording a cpu stamp in each lock instance.

Contention bouncing requires the cpu stamp to be set on acquisition. Hence we
move __acquired into the generic path.

__acquired is then used to measure acquisition bouncing by comparing the
current cpu with the old stamp before replacing it.

__contended is used to measure contention bouncing (only useful for preemptable
locks)

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep: various fixes</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b32d0a4e9ec07808a5c406a416c6576c986b047'/>
<id>urn:sha1:4b32d0a4e9ec07808a5c406a416c6576c986b047</id>
<content type='text'>
 - update the copyright notices
 - use the default hash function
 - fix a thinko in a BUILD_BUG_ON
 - add a WARN_ON to spot inconsitent naming
 - fix a termination issue in /proc/lock_stat

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockstat: human readability tweaks</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:48:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c46261de0d98372112d8edf16f74ce418a268d46'/>
<id>urn:sha1:c46261de0d98372112d8edf16f74ce418a268d46</id>
<content type='text'>
Present all this fancy new lock statistics information:

*warning, _wide_ output ahead*

(output edited for purpose of brevity)

 # cat /proc/lock_stat
lock_stat version 0.1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
                              class name    contentions   waittime-min   waittime-max waittime-total   acquisitions   holdtime-min   holdtime-max holdtime-total
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

                         &amp;inode-&gt;i_mutex:         14458           6.57      398832.75     2469412.23        6768876           0.34    11398383.65   339410830.89
                         ---------------
                         &amp;inode-&gt;i_mutex           4486          [&lt;ffffffff802a08f9&gt;] pipe_wait+0x86/0x8d
                         &amp;inode-&gt;i_mutex              0          [&lt;ffffffff802a01e8&gt;] pipe_write_fasync+0x29/0x5d
                         &amp;inode-&gt;i_mutex              0          [&lt;ffffffff802a0e18&gt;] pipe_read+0x74/0x3a5
                         &amp;inode-&gt;i_mutex              0          [&lt;ffffffff802a1a6a&gt;] do_lookup+0x81/0x1ae

.................................................................................................................................................................

              &amp;inode-&gt;i_data.tree_lock-W:           491           0.27          62.47         493.89        2477833           0.39         468.89     1146584.25
              &amp;inode-&gt;i_data.tree_lock-R:            65           0.44           4.27          48.78       26288792           0.36         184.62    10197458.24
              --------------------------
                &amp;inode-&gt;i_data.tree_lock             46          [&lt;ffffffff80277095&gt;] __do_page_cache_readahead+0x69/0x24f
                &amp;inode-&gt;i_data.tree_lock             31          [&lt;ffffffff8026f9fb&gt;] add_to_page_cache+0x31/0xba
                &amp;inode-&gt;i_data.tree_lock              0          [&lt;ffffffff802770ee&gt;] __do_page_cache_readahead+0xc2/0x24f
                &amp;inode-&gt;i_data.tree_lock              0          [&lt;ffffffff8026f6e4&gt;] find_get_page+0x1a/0x58

.................................................................................................................................................................

                      proc_inum_idr.lock:             0           0.00           0.00           0.00             36           0.00          65.60         148.26
                        proc_subdir_lock:             0           0.00           0.00           0.00        3049859           0.00         106.81     1563212.42
                        shrinker_rwsem-W:             0           0.00           0.00           0.00              5           0.00           1.73           3.68
                        shrinker_rwsem-R:             0           0.00           0.00           0.00            633           2.57         246.57       10909.76

'contentions' and 'acquisitions' are the number of such events measured (since
the last reset). The waittime- and holdtime- (min, max, total) numbers are
presented in microseconds.

If there are any contention points, the lock class is presented in the block
format (as i_mutex and tree_lock above), otherwise a single line of output is
presented.

The output is sorted on absolute number of contentions (read + write), this
should get the worst offenders presented first, so that:

 # grep : /proc/lock_stat | head

will quickly show who's bad.

The stats can be reset using:

 # echo 0 &gt; /proc/lock_stat

[bunk@stusta.de: make 2 functions static]
[akpm@linux-foundation.org: fix printk warning]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockstat: core infrastructure</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f20786ff4da51e56b1956acf30be2552be266746'/>
<id>urn:sha1:f20786ff4da51e56b1956acf30be2552be266746</id>
<content type='text'>
Introduce the core lock statistics code.

Lock statistics provides lock wait-time and hold-time (as well as the count
of corresponding contention and acquisitions events). Also, the first few
call-sites that encounter contention are tracked.

Lock wait-time is the time spent waiting on the lock. This provides insight
into the locking scheme, that is, a heavily contended lock is indicative of
a too coarse locking scheme.

Lock hold-time is the duration the lock was held, this provides a reference for
the wait-time numbers, so they can be put into perspective.

  1)
    lock
  2)
    ... do stuff ..
    unlock
  3)

The time between 1 and 2 is the wait-time. The time between 2 and 3 is the
hold-time.

The lockdep held-lock tracking code is reused, because it already collects locks
into meaningful groups (classes), and because it is an existing infrastructure
for lock instrumentation.

Currently lockdep tracks lock acquisition with two hooks:

  lock()
    lock_acquire()
    _lock()

 ... code protected by lock ...

  unlock()
    lock_release()
    _unlock()

We need to extend this with two more hooks, in order to measure contention.

  lock_contended() - used to measure contention events
  lock_acquired()  - completion of the contention

These are then placed the following way:

  lock()
    lock_acquire()
    if (!_try_lock())
      lock_contended()
      _lock()
      lock_acquired()

 ... do locked stuff ...

  unlock()
    lock_release()
    _unlock()

(Note: the try_lock() 'trick' is used to avoid instrumenting all platform
       dependent lock primitive implementations.)

It is also possible to toggle the two lockdep features at runtime using:

  /proc/sys/kernel/prove_locking
  /proc/sys/kernel/lock_stat

(esp. turning off the O(n^2) prove_locking functionaliy can help)

[akpm@linux-foundation.org: build fixes]
[akpm@linux-foundation.org: nuke unneeded ifdefs]
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep: reduce the ifdeffery</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e18257d29238311e82085152741f0c3aa18b74d'/>
<id>urn:sha1:8e18257d29238311e82085152741f0c3aa18b74d</id>
<content type='text'>
Move code around to get fewer but larger #ifdef sections.  Break some
in-function #ifdefs out into their own functions.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep: sanitise CONFIG_PROVE_LOCKING</title>
<updated>2007-07-19T17:04:49Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2007-07-19T08:48:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca58abcb4a6d52ee2db1b1130cea3ca2a76677b9'/>
<id>urn:sha1:ca58abcb4a6d52ee2db1b1130cea3ca2a76677b9</id>
<content type='text'>
Ensure that all of the lock dependency tracking code is under
CONFIG_PROVE_LOCKING.  This allows us to use the held lock tracking code for
other purposes.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kallsyms: make KSYM_NAME_LEN include space for trailing '\0'</title>
<updated>2007-07-17T17:23:03Z</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2007-07-17T11:03:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9281acea6a3687ff0f262e0be31eac34895b95d7'/>
<id>urn:sha1:9281acea6a3687ff0f262e0be31eac34895b95d7</id>
<content type='text'>
KSYM_NAME_LEN is peculiar in that it does not include the space for the
trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating
buffer.  This is nonsense and error-prone.  Moreover, when the caller
forgets that it's very likely to subtly bite back by corrupting the stack
because the last position of the buffer is always cleared to zero.

This patch increments KSYM_NAME_LEN by one and updates code accordingly.

* off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro
  is fixed.

* Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together,
  MODULE_NAME_LEN was treated as if it didn't include space for the
  trailing '\0'.  Fix it.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Acked-by: Paulo Marques &lt;pmarques@grupopie.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep: removed unused ip argument in mark_lock &amp; mark_held_locks</title>
<updated>2007-05-08T18:15:13Z</updated>
<author>
<name>Jarek Poplawski</name>
<email>jarkao2@o2.pl</email>
</author>
<published>2007-05-08T07:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ff773bbde87f7f7dddc0f579ad53e077a6587b9'/>
<id>urn:sha1:4ff773bbde87f7f7dddc0f579ad53e077a6587b9</id>
<content type='text'>
It looks like a remainder from designing...

Signed-off-by: Jarek Poplawski &lt;jarkao@o2.pl&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lockdep: lookup_chain_cache comment errata</title>
<updated>2007-05-08T18:15:11Z</updated>
<author>
<name>Jarek Poplawski</name>
<email>jarkao2@o2.pl</email>
</author>
<published>2007-05-08T07:30:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e860d000a90cfc9ca270ddb6e99b177e6aa91cd'/>
<id>urn:sha1:9e860d000a90cfc9ca270ddb6e99b177e6aa91cd</id>
<content type='text'>
Signed-off-by: Jarek Poplawski &lt;jarkao2@o2.pl&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
