diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2015-11-23 19:20:06 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-12-10 10:38:58 -0500 |
commit | 86bad0c7071c24efee0a395d8b622764bdd24320 (patch) | |
tree | 49fa95844e79ed05c16735dfa31cb6953683836d /drivers/md/Kconfig | |
parent | f98c8f797021e78ba27143ecd39c51995c47aa8b (diff) | |
download | linux-86bad0c7071c24efee0a395d8b622764bdd24320.tar.bz2 |
dm bufio: store stacktrace in buffers to help find buffer leaks
The option DM_DEBUG_BLOCK_STACK_TRACING is moved from persistent-data
directory to device mapper directory because it will now be used by
persistent-data and bufio. When the option is enabled, each bufio buffer
stores the stacktrace of the last dm_bufio_get(), dm_bufio_read() or
dm_bufio_new() call that increased the hold count to 1. The buffer's
stacktrace is printed if the buffer was not released before the bufio
client is destroyed.
When DM_DEBUG_BLOCK_STACK_TRACING is enabled, any bufio buffer leaks are
considered warnings - i.e. the kernel continues afterwards. If not
enabled, buffer leaks are considered BUGs and the kernel with crash.
Reasoning on this disposition is: if we only ever warned on buffer leaks
users would generally ignore them and the problematic code would never
get fixed.
Successfully used to find source of bufio leaks fixed with commit
fce079f63c3 ("dm btree: fix bufio buffer leaks in dm_btree_del() error
path").
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/Kconfig')
-rw-r--r-- | drivers/md/Kconfig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index 7913fdcfc849..1b69359461e9 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig @@ -240,6 +240,15 @@ config DM_BUFIO as a cache, holding recently-read blocks in memory and performing delayed writes. +config DM_DEBUG_BLOCK_STACK_TRACING + bool "Keep stack trace of persistent data block lock holders" + depends on STACKTRACE_SUPPORT && DM_BUFIO + select STACKTRACE + ---help--- + Enable this for messages that may help debug problems with the + block manager locking used by thin provisioning and caching. + + If unsure, say N. config DM_BIO_PRISON tristate depends on BLK_DEV_DM |