[PATCH v2 0/9] preempt: Add a generic function to return the preemption string.

Sebastian Andrzej Siewior posted 9 patches 1 year ago
There is a newer version of this series
arch/arm/kernel/traps.c      | 11 ++-------
arch/arm64/kernel/traps.c    | 10 +-------
arch/powerpc/kernel/traps.c  |  4 +--
arch/s390/kernel/dumpstack.c |  9 ++-----
arch/x86/kernel/dumpstack.c  |  9 ++-----
arch/xtensa/kernel/traps.c   |  6 +----
include/linux/preempt.h      |  2 ++
kernel/sched/core.c          | 47 ++++++++++++++++++++++++++++++++++++
kernel/sched/debug.c         | 10 +++++---
kernel/sched/sched.h         |  1 +
kernel/trace/trace.c         |  7 +-----
lib/dump_stack.c             |  4 +--
12 files changed, 69 insertions(+), 51 deletions(-)
[PATCH v2 0/9] preempt: Add a generic function to return the preemption string.
Posted by Sebastian Andrzej Siewior 1 year ago
The individual architectures often add the preemption model to the begin
of the backtrace. This is the case on X86 or ARM64 for the "die" case
but not for regular warning. With the addition of DYNAMIC_PREEMPT for
PREEMPT_RT we end up with CONFIG_PREEMPT and CONFIG_PREEMPT_RT set
simultaneously. That means that everyone who tried to add that piece of
information gets it wrong for PREEMPT_RT because PREEMPT is checked
first.

This series adds a generic helper which is used by
dump_stack_print_info() and other architectures which don't use the
function and provide this information on their own.

RFC…v2 https://lore.kernel.org/all/20241206113431.Q-VXMlru@linutronix.de/
  - Split into individual patches.
  - Implement preempt_model_str() based on feedback by Peter Zijlstra
    and Steven Rostedt.

Sebastian

Sebastian Andrzej Siewior (9):
  sched: Add a generic function to return the preemption string.
  lib/dump_stack: Use preempt_model_str().
  arm: Rely on generic printing of preemption model.
  arm64: Rely on generic printing of preemption model.
  powerpc: Use preempt_model_str().
  s390: Rely on generic printing of preemption model.
  x86: Rely on generic printing of preemption model.
  xtensa: Use preempt_model_str().
  tracing: Use preempt_model_str().

 arch/arm/kernel/traps.c      | 11 ++-------
 arch/arm64/kernel/traps.c    | 10 +-------
 arch/powerpc/kernel/traps.c  |  4 +--
 arch/s390/kernel/dumpstack.c |  9 ++-----
 arch/x86/kernel/dumpstack.c  |  9 ++-----
 arch/xtensa/kernel/traps.c   |  6 +----
 include/linux/preempt.h      |  2 ++
 kernel/sched/core.c          | 47 ++++++++++++++++++++++++++++++++++++
 kernel/sched/debug.c         | 10 +++++---
 kernel/sched/sched.h         |  1 +
 kernel/trace/trace.c         |  7 +-----
 lib/dump_stack.c             |  4 +--
 12 files changed, 69 insertions(+), 51 deletions(-)

-- 
2.47.2
Re: [PATCH v2 0/9] preempt: Add a generic function to return the preemption string.
Posted by Peter Zijlstra 1 year ago
On Mon, Feb 03, 2025 at 03:16:23PM +0100, Sebastian Andrzej Siewior wrote:
> The individual architectures often add the preemption model to the begin
> of the backtrace. This is the case on X86 or ARM64 for the "die" case
> but not for regular warning. With the addition of DYNAMIC_PREEMPT for
> PREEMPT_RT we end up with CONFIG_PREEMPT and CONFIG_PREEMPT_RT set
> simultaneously. That means that everyone who tried to add that piece of
> information gets it wrong for PREEMPT_RT because PREEMPT is checked
> first.
> 
> This series adds a generic helper which is used by
> dump_stack_print_info() and other architectures which don't use the
> function and provide this information on their own.
> 
> RFC…v2 https://lore.kernel.org/all/20241206113431.Q-VXMlru@linutronix.de/
>   - Split into individual patches.
>   - Implement preempt_model_str() based on feedback by Peter Zijlstra
>     and Steven Rostedt.
> 
> Sebastian
> 
> Sebastian Andrzej Siewior (9):
>   sched: Add a generic function to return the preemption string.
>   lib/dump_stack: Use preempt_model_str().
>   arm: Rely on generic printing of preemption model.
>   arm64: Rely on generic printing of preemption model.
>   powerpc: Use preempt_model_str().
>   s390: Rely on generic printing of preemption model.
>   x86: Rely on generic printing of preemption model.
>   xtensa: Use preempt_model_str().
>   tracing: Use preempt_model_str().

Works for me; how do we want to go about merging this?

I can take it through the sched tree I suppose, once the various arch
people have blessed it.
Re: [PATCH v2 0/9] preempt: Add a generic function to return the preemption string.
Posted by Sebastian Andrzej Siewior 1 year ago
On 2025-02-03 15:25:05 [+0100], Peter Zijlstra wrote:
> Works for me; how do we want to go about merging this?

Thank you.

> I can take it through the sched tree I suppose, once the various arch
> people have blessed it.

I guess this is the easiest part. I would ping those who did not ACK
their bits next week.

Sebastian