Re: [PATCH v2] x86/dumpstack: allow preemption in show_stack_log_lvl() and dump_trace()
From: Ingo Molnar
Date: Tue Sep 13 2016 - 14:30:09 EST
* Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> show_stack_log_lvl() and dump_trace() are already preemption safe:
>
> - If they're running in irq or exception context, preemption is already
> disabled and the percpu stack pointers can be trusted.
>
> - If they're running with preemption enabled, they must be running on
> the task stack anyway, so it doesn't matter if they're comparing the
> stack pointer against a percpu stack pointer from this CPU or another
> one: either way it won't match.
Yeah, so I'm having second thoughts about this patch. My worry here is: what if we
get preempted in this sequence?
If the kernel is borked real bad then we could get technically correct but really,
really weird looking stack traces if for example the task stack is getting
corrupted or something like that.
Dunno. How long does the worst-case processing here take on a typical x86 system,
does it really matter to scheduling latency?
Thanks,
Ingo