]> Git Repo - linux.git/commitdiff
x86/stacktrace: Remove the pointless ULONG_MAX marker
authorThomas Gleixner <[email protected]>
Wed, 10 Apr 2019 10:27:56 +0000 (12:27 +0200)
committerThomas Gleixner <[email protected]>
Sun, 14 Apr 2019 17:58:27 +0000 (19:58 +0200)
Terminating the last trace entry with ULONG_MAX is a completely pointless
exercise and none of the consumers can rely on it because it's
inconsistently implemented across architectures. In fact quite some of the
callers remove the entry and adjust stack_trace.nr_entries afterwards.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
arch/x86/kernel/stacktrace.c

index 5c2d71a1dc069fd2b7ea2457fdd83e85c5e3383a..b2f706f1e0b7aa9d10392e66f0372daf59cdb87a 100644 (file)
@@ -46,9 +46,6 @@ static void noinline __save_stack_trace(struct stack_trace *trace,
                if (!addr || save_stack_address(trace, addr, nosched))
                        break;
        }
-
-       if (trace->nr_entries < trace->max_entries)
-               trace->entries[trace->nr_entries++] = ULONG_MAX;
 }
 
 /*
@@ -97,7 +94,7 @@ __save_stack_trace_reliable(struct stack_trace *trace,
                if (regs) {
                        /* Success path for user tasks */
                        if (user_mode(regs))
-                               goto success;
+                               return 0;
 
                        /*
                         * Kernel mode registers on the stack indicate an
@@ -132,10 +129,6 @@ __save_stack_trace_reliable(struct stack_trace *trace,
        if (!(task->flags & (PF_KTHREAD | PF_IDLE)))
                return -EINVAL;
 
-success:
-       if (trace->nr_entries < trace->max_entries)
-               trace->entries[trace->nr_entries++] = ULONG_MAX;
-
        return 0;
 }
 
@@ -221,9 +214,6 @@ void save_stack_trace_user(struct stack_trace *trace)
        /*
         * Trace user stack if we are not a kernel thread
         */
-       if (current->mm) {
+       if (current->mm)
                __save_stack_trace_user(trace);
-       }
-       if (trace->nr_entries < trace->max_entries)
-               trace->entries[trace->nr_entries++] = ULONG_MAX;
 }
This page took 0.060991 seconds and 4 git commands to generate.