17 Aug, 2009
4 commits
-
- make lc_next() call lc_start()
- use lock_chains directly instead of storing it in m->privateSigned-off-by: Li Zefan
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Use seq_list_start_head() and seq_list_next().
Signed-off-by: Li Zefan
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Two entries are missing in the output of /proc/lock_chains.
One is chains[1]. When lc_next() is called the 1st time,
chains[0] is returned. And when it's called the 2nd time,
chains[2] is returned.The other missing ons is, when lc_start() is called the 2nd
time, we should start from chains[@pos-1] but not chains[@pos],
because pos == 0 is the header.Signed-off-by: Li Zefan
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
One entry is missing in the output of /proc/lock_stat.
The cause is, when ls_start() is called the 2nd time, we should
start from stats[@pos-1] but not stats[@pos], because pos == 0
is the header.Signed-off-by: Li Zefan
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
02 Aug, 2009
7 commits
-
The unit is KB, so sizeof(struct circular_queue) should be
divided by 1024.Signed-off-by: Ming Lei
Cc: akpm@linux-foundation.org
Cc: torvalds@linux-foundation.org
Cc: davem@davemloft.net
Cc: Ming Lei
Cc: a.p.zijlstra@chello.nl
LKML-Reference:
Signed-off-by: Ingo Molnar -
We still can apply DaveM's generation count optimization to
BFS, based on the following idea:- before doing each BFS, increase the global generation id
by 1- if one node in the graph has been visited, mark it as
visited by storing the current global generation id into
the node's dep_gen_id field- so we can decide if one node has been visited already, by
comparing the node's dep_gen_id with the global generation id.By applying DaveM's generation count optimization to current
implementation of BFS, we gain the following advantages:- we save MAX_LOCKDEP_ENTRIES/8 bytes memory;
- we remove the bitmap_zero(bfs_accessed, MAX_LOCKDEP_ENTRIES);
in each BFS, which is very time-consuming since
MAX_LOCKDEP_ENTRIES may be very large.(16384UL)Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
Cc: "David S. Miller"
LKML-Reference:
Signed-off-by: Ingo Molnar -
spin_lock_nest_lock() allows to take many instances of the same
class, this can easily lead to overflow of MAX_LOCK_DEPTH.To avoid this overflow, we'll stop accounting instances but
start reference counting the class in the held_lock structure.[ We could maintain a list of instances, if we'd move the hlock
stuff into __lock_acquired(), but that would require
significant modifications to the current code. ]We restrict this mode to spin_lock_nest_lock() only, because it
degrades the lockdep quality due to lost of instance.For lockstat this means we don't track lock statistics for any
but the first lock in the series.Currently nesting is limited to 11 bits because that was the
spare space available in held_lock. This yields a 2048
instances maximium.Signed-off-by: Peter Zijlstra
Cc: Marcelo Tosatti
Cc: Linus Torvalds
Signed-off-by: Ingo Molnar -
Add a lockdep helper to validate that we indeed are the owner
of a lock.Signed-off-by: Peter Zijlstra
Signed-off-by: Ingo Molnar -
fixes a few comments and whitespaces that annoyed me.
Signed-off-by: Peter Zijlstra
Signed-off-by: Ingo Molnar -
Truncate stupid -1 entries in backtraces.
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Fix:
kernel/built-in.o: In function `lockdep_stats_show':
lockdep_proc.c:(.text+0x48202): undefined reference to `max_bfs_queue_depth'As max_bfs_queue_depth is only available under
CONFIG_PROVE_LOCKING=y.Cc: Ming Lei
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
24 Jul, 2009
10 commits
-
Some cleanups of the lockdep code after the BFS series:
- Remove the last traces of the generation id
- Fixup comment style
- Move the bfs routines into lockdep.c
- Cleanup the bfs routines[ tom.leiming@gmail.com: Fix crash ]
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Add BFS statistics to the existing lockdep stats.
Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Also account the BFS memory usage.
Signed-off-by: Ming Lei
[ fix build for !PROVE_LOCKING ]
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Implement lockdep_count_{for,back}ward using BFS.
Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Since the shortest lock dependencies' path may be obtained by BFS,
we print the shortest one by print_shortest_lock_dependencies().Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
This patch uses BFS to implement find_usage_*wards(),which
was originally writen by DFS.Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
This patch uses BFS to implement check_noncircular() and
prints the generated shortest circle if exists.Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
1,introduce match() to BFS in order to make it usable to
match different pattern;2,also rename some functions to make them more suitable.
Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
1,replace %MAX_CIRCULAR_QUE_SIZE with &(MAX_CIRCULAR_QUE_SIZE-1)
since we define MAX_CIRCULAR_QUE_SIZE as power of 2;2,use bitmap to mark if a lock is accessed in BFS in order to
clear it quickly, because we may search a graph many times.Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar -
Currently lockdep will print the 1st circle detected if it
exists when acquiring a new (next) lock.This patch prints the shortest path from the next lock to be
acquired to the previous held lock if a circle is found.The patch still uses the current method to check circle, and
once the circle is found, breadth-first search algorithem is
used to compute the shortest path from the next lock to the
previous lock in the forward lock dependency graph.Printing the shortest path will shorten the dependency chain,
and make troubleshooting for possible circular locking easier.Signed-off-by: Ming Lei
Signed-off-by: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
23 Jul, 2009
19 commits
-
…git/tip/linux-2.6-tip
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Fix UP compile failure caused by irq_thread_check_affinity -
…t/peterz/linux-2.6-lockdep
* 'lockdep-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
lockdep: Fix lockdep annotation for pipe_double_lock() -
Since genirq: Delegate irq affinity setting to the irq thread
(591d2fb02ea80472d846c0b8507007806bdd69cc) compilation with
CONFIG_SMP=n fails with following error:/usr/src/linux-2.6/kernel/irq/manage.c:
In function 'irq_thread_check_affinity':
/usr/src/linux-2.6/kernel/irq/manage.c:475:
error: 'struct irq_desc' has no member named 'affinity'
make[4]: *** [kernel/irq/manage.o] Error 1That commit adds a new function irq_thread_check_affinity() which
uses struct irq_desc.affinity which is only available for CONFIG_SMP=y.
Move that function under #ifdef CONFIG_SMP.[ tglx@brownpaperbag: compile and boot tested on UP and SMP ]
Signed-off-by: Bruno Premont
LKML-Reference:
Signed-off-by: Thomas Gleixner -
The presumed use of the pipe_double_lock() routine is to lock 2 locks in
a deadlock free way by ordering the locks by their address. However it
fails to keep the specified lock classes in order and explicitly
annotates a deadlock.Rectify this.
Signed-off-by: Peter Zijlstra
Acked-by: Miklos Szeredi
LKML-Reference: -
…nel/git/peterz/linux-2.6-perf
* 'perf-counters-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-perf: (31 commits)
perf_counter tools: Give perf top inherit option
perf_counter tools: Fix vmlinux symbol generation breakage
perf_counter: Detect debugfs location
perf_counter: Add tracepoint support to perf list, perf stat
perf symbol: C++ demangling
perf: avoid structure size confusion by using a fixed size
perf_counter: Fix throttle/unthrottle event logging
perf_counter: Improve perf stat and perf record option parsing
perf_counter: PERF_SAMPLE_ID and inherited counters
perf_counter: Plug more stack leaks
perf: Fix stack data leak
perf_counter: Remove unused variables
perf_counter: Make call graph option consistent
perf_counter: Add perf record option to log addresses
perf_counter: Log vfork as a fork event
perf_counter: Synthesize VDSO mmap event
perf_counter: Make sure we dont leak kernel memory to userspace
perf_counter tools: Fix index boundary check
perf_counter: Fix the tracepoint channel to perfcounters
perf_counter, x86: Extend perf_counter Pentium M support
... -
…el/git/tip/linux-2.6-tip
* 'core-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
softirq: introduce tasklet_hrtimer infrastructure -
…el/git/tip/linux-2.6-tip
* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clocksource: Prevent NULL pointer dereference
timer: Avoid reading uninitialized data -
…git/tip/linux-2.6-tip
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Delegate irq affinity setting to the irq thread -
…l/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: fix nr_uninterruptible accounting of frozen tasks really
sched: fix load average accounting vs. cpu hotplug
sched: Account for vruntime wrapping -
* 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc:
virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
ataflop: adjust NULL test
block: fix failfast merge testing in elv_rq_merge_ok()
z2ram: Small cleanup for z2ram.c -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
fs/Kconfig: move nilfs2 out -
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
ide-tape: Don't leak kernel stack information
ide: fix memory leak when flush command is issued -
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
sky2: Avoid races in sky2_down
drivers/net/mlx4: Adjust constant
drivers/net: Move a dereference below a NULL test
drivers/net: Move a dereference below a NULL test
connector: maintainer/mail update.
USB host CDC Phonet network interface driver
macsonic, jazzsonic: fix oops on module unload
macsonic: move probe function to .devinit.text
can: switch carrier on if device was stopped while in bus-off state
can: restart device even if dev_alloc_skb() fails
can: sja1000: remove duplicated includes
New device ID for sc92031 [1088:2031]
3c589_cs: re-initialize the multicast in the tc589_reset
Fix error return for setsockopt(SO_TIMESTAMPING)
netxen: fix thermal check and shutdown
netxen: fix deadlock on dev close
netxen: fix context deletion sequence
net: Micrel KS8851 SPI network driver
tcp: Use correct peer adr when copying MD5 keys
tcp: Fix MD5 signature checking on IPv4 mapped sockets
... -
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
NFSv4: Fix a problem whereby a buggy server can oops the kernel
NFSv4: Fix an NFSv4 mount regression
NFSv4: Fix an Oops in nfs4_free_lock_state -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: ctxfi: Swapped SURROUND-SIDE channels on emu20k2
ALSA: ca0106 - Fix the max capture buffer size
ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
ALSA: hda - Add quirk for Gateway T6834c laptop
ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
ALSA: hda_codec: Check for invalid zero connections -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: Move dereferences below a NULL test
HID: hiddev, fix lock imbalance -
the "reserved" field was not initialized to zero, resulting in 4 bytes
of stack data leaking to userspace....Signed-off-by: Arjan van de Ven
Acked-by: Peter Zijlstra
Signed-off-by: Linus Torvalds -
* 'linux-next' of git://git.infradead.org/ubi-2.6:
UBI: fix bug in image sequence number handling
UBI: gluebi: initialize ubi_num field