diff mbox series

[RFC,23/41] mm/slub: Simplify stack trace retrieval

Message ID 20190410103645.685114415@linutronix.de (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Thomas Gleixner April 10, 2019, 10:28 a.m. UTC
Replace the indirection through struct stack_trace with an invocation of
the storage array based interface.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: linux-mm@kvack.org
Cc: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
---
 mm/slub.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

--- a/mm/slub.c
+++ b/mm/slub.c
@@ -552,18 +552,14 @@  static void set_track(struct kmem_cache
 
 	if (addr) {
 #ifdef CONFIG_STACKTRACE
-		struct stack_trace trace;
+		unsigned int nent;
 
-		trace.nr_entries = 0;
-		trace.max_entries = TRACK_ADDRS_COUNT;
-		trace.entries = p->addrs;
-		trace.skip = 3;
 		metadata_access_enable();
-		save_stack_trace(&trace);
+		nent = stack_trace_save(p->addrs, TRACK_ADDRS_COUNT, 3);
 		metadata_access_disable();
 
-		if (trace.nr_entries < TRACK_ADDRS_COUNT)
-			p->addrs[trace.nr_entries] = 0;
+		if (nent < TRACK_ADDRS_COUNT)
+			p->addrs[nent] = 0;
 #endif
 		p->addr = addr;
 		p->cpu = smp_processor_id();