summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-04-25 05:45:08 -0400
committerThomas Gleixner <tglx@linutronix.de>2019-04-29 06:37:52 -0400
commitbe9c52ed84eb0949fed3d4140e35ea70eecb02a2 (patch)
tree10f41d5bbabf5aa2e4a53224da53d1686d5cd6d2
parent741b58f3e23673a666c700361711a91022a69e56 (diff)
dm persistent data: Simplify stack trace handling
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. This results in less storage space and indirection. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: dm-devel@redhat.com Cc: Mike Snitzer <snitzer@redhat.com> Cc: Alasdair Kergon <agk@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Alexander Potapenko <glider@google.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: linux-mm@kvack.org Cc: David Rientjes <rientjes@google.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: kasan-dev@googlegroups.com Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Cc: iommu@lists.linux-foundation.org Cc: Robin Murphy <robin.murphy@arm.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Cc: David Sterba <dsterba@suse.com> Cc: Chris Mason <clm@fb.com> Cc: Josef Bacik <josef@toxicpanda.com> Cc: linux-btrfs@vger.kernel.org Cc: Daniel Vetter <daniel@ffwll.ch> Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: dri-devel@lists.freedesktop.org Cc: David Airlie <airlied@linux.ie> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tom Zanussi <tom.zanussi@linux.intel.com> Cc: Miroslav Benes <mbenes@suse.cz> Cc: linux-arch@vger.kernel.org Link: https://lkml.kernel.org/r/20190425094802.533968922@linutronix.de
-rw-r--r--drivers/md/persistent-data/dm-block-manager.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c
index 3972232b8037..749ec268d957 100644
--- a/drivers/md/persistent-data/dm-block-manager.c
+++ b/drivers/md/persistent-data/dm-block-manager.c
@@ -35,7 +35,10 @@
35#define MAX_HOLDERS 4 35#define MAX_HOLDERS 4
36#define MAX_STACK 10 36#define MAX_STACK 10
37 37
38typedef unsigned long stack_entries[MAX_STACK]; 38struct stack_store {
39 unsigned int nr_entries;
40 unsigned long entries[MAX_STACK];
41};
39 42
40struct block_lock { 43struct block_lock {
41 spinlock_t lock; 44 spinlock_t lock;
@@ -44,8 +47,7 @@ struct block_lock {
44 struct task_struct *holders[MAX_HOLDERS]; 47 struct task_struct *holders[MAX_HOLDERS];
45 48
46#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 49#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
47 struct stack_trace traces[MAX_HOLDERS]; 50 struct stack_store traces[MAX_HOLDERS];
48 stack_entries entries[MAX_HOLDERS];
49#endif 51#endif
50}; 52};
51 53
@@ -73,7 +75,7 @@ static void __add_holder(struct block_lock *lock, struct task_struct *task)
73{ 75{
74 unsigned h = __find_holder(lock, NULL); 76 unsigned h = __find_holder(lock, NULL);
75#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 77#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
76 struct stack_trace *t; 78 struct stack_store *t;
77#endif 79#endif
78 80
79 get_task_struct(task); 81 get_task_struct(task);
@@ -81,11 +83,7 @@ static void __add_holder(struct block_lock *lock, struct task_struct *task)
81 83
82#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 84#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
83 t = lock->traces + h; 85 t = lock->traces + h;
84 t->nr_entries = 0; 86 t->nr_entries = stack_trace_save(t->entries, MAX_STACK, 2);
85 t->max_entries = MAX_STACK;
86 t->entries = lock->entries[h];
87 t->skip = 2;
88 save_stack_trace(t);
89#endif 87#endif
90} 88}
91 89
@@ -106,7 +104,8 @@ static int __check_holder(struct block_lock *lock)
106 DMERR("recursive lock detected in metadata"); 104 DMERR("recursive lock detected in metadata");
107#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 105#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
108 DMERR("previously held here:"); 106 DMERR("previously held here:");
109 print_stack_trace(lock->traces + i, 4); 107 stack_trace_print(lock->traces[i].entries,
108 lock->traces[i].nr_entries, 4);
110 109
111 DMERR("subsequent acquisition attempted here:"); 110 DMERR("subsequent acquisition attempted here:");
112 dump_stack(); 111 dump_stack();