Commit b8ca7ff7 authored by Thomas Gleixner's avatar Thomas Gleixner

mm/slub: Remove the ULONG_MAX stack trace hackery

No architecture terminates the stack trace with ULONG_MAX anymore. Remove
the cruft.

While at it remove the pointless loop of clearing the stack array
completely. It's sufficient to clear the last entry as the consumers break
out on the first zeroed entry anyway.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexander Potapenko <glider@google.com>
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>
Link: https://lkml.kernel.org/r/20190410103644.574058244@linutronix.de
parent 2dfed456
...@@ -553,7 +553,6 @@ static void set_track(struct kmem_cache *s, void *object, ...@@ -553,7 +553,6 @@ static void set_track(struct kmem_cache *s, void *object,
if (addr) { if (addr) {
#ifdef CONFIG_STACKTRACE #ifdef CONFIG_STACKTRACE
struct stack_trace trace; struct stack_trace trace;
int i;
trace.nr_entries = 0; trace.nr_entries = 0;
trace.max_entries = TRACK_ADDRS_COUNT; trace.max_entries = TRACK_ADDRS_COUNT;
...@@ -563,20 +562,16 @@ static void set_track(struct kmem_cache *s, void *object, ...@@ -563,20 +562,16 @@ static void set_track(struct kmem_cache *s, void *object,
save_stack_trace(&trace); save_stack_trace(&trace);
metadata_access_disable(); metadata_access_disable();
/* See rant in lockdep.c */ if (trace.nr_entries < TRACK_ADDRS_COUNT)
if (trace.nr_entries != 0 && p->addrs[trace.nr_entries] = 0;
trace.entries[trace.nr_entries - 1] == ULONG_MAX)
trace.nr_entries--;
for (i = trace.nr_entries; i < TRACK_ADDRS_COUNT; i++)
p->addrs[i] = 0;
#endif #endif
p->addr = addr; p->addr = addr;
p->cpu = smp_processor_id(); p->cpu = smp_processor_id();
p->pid = current->pid; p->pid = current->pid;
p->when = jiffies; p->when = jiffies;
} else } else {
memset(p, 0, sizeof(struct track)); memset(p, 0, sizeof(struct track));
}
} }
static void init_tracking(struct kmem_cache *s, void *object) static void init_tracking(struct kmem_cache *s, void *object)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment