Commit-ID:  7971679994d3a239538ddcfea9f89468f0bd65e2
Gitweb:     https://git.kernel.org/tip/7971679994d3a239538ddcfea9f89468f0bd65e2
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Thu, 25 Apr 2019 11:45:00 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 29 Apr 2019 12:37:48 +0200

mm/slub: Simplify stack trace retrieval

Replace the indirection through struct stack_trace with an invocation of
the storage array based interface.

Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: [email protected]
Cc: David Rientjes <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: [email protected]
Cc: Mike Rapoport <[email protected]>
Cc: Akinobu Mita <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: [email protected]
Cc: Robin Murphy <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Johannes Thumshirn <[email protected]>
Cc: David Sterba <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Josef Bacik <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Mike Snitzer <[email protected]>
Cc: Alasdair Kergon <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Cc: Joonas Lahtinen <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: [email protected]
Cc: David Airlie <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Miroslav Benes <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]

---
 mm/slub.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index e2ccd12b6faa..6b28cd2b5a58 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -552,18 +552,14 @@ static void set_track(struct kmem_cache *s, void *object,
 
        if (addr) {
 #ifdef CONFIG_STACKTRACE
-               struct stack_trace trace;
+               unsigned int nr_entries;
 
-               trace.nr_entries = 0;
-               trace.max_entries = TRACK_ADDRS_COUNT;
-               trace.entries = p->addrs;
-               trace.skip = 3;
                metadata_access_enable();
-               save_stack_trace(&trace);
+               nr_entries = 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 (nr_entries < TRACK_ADDRS_COUNT)
+                       p->addrs[nr_entries] = 0;
 #endif
                p->addr = addr;
                p->cpu = smp_processor_id();

Reply via email to