All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC patch 00/41] stacktrace: Avoid the pointless redirection through struct stack_trace
@ 2019-04-10 10:27 Thomas Gleixner
  2019-04-10 10:27   ` Thomas Gleixner
                   ` (41 more replies)
  0 siblings, 42 replies; 106+ messages in thread
From: Thomas Gleixner @ 2019-04-10 10:27 UTC (permalink / raw)
  To: LKML
  Cc: Josh Poimboeuf, x86, Andy Lutomirski, Steven Rostedt,
	Alexander Potapenko

Struct stack_trace is a sinkhole for input and output parameters which is
largely pointless for most usage sites. In fact if embedded into other data
structures it creates indirections and extra storage overhead for no benefit.

Looking at all usage sites makes it clear that they just require an
interface which is based on a storage array. That array is either on stack,
global or embedded into some other data structure.

Some of the stack depot usage sites are outright wrong, but fortunately the
wrongness just causes more stack being used for nothing and does not have
functional impact.

Another oddity is the inconsistent termination of the stack trace with
ULONG_MAX. It's pointless as the number of entries is what determines the
length of the stored trace. In fact quite some call sites remove the
ULONG_MAX marker afterwards with or without nasty comments about it. Not
all architectures do that and those which do, do it inconsistenly either
conditional on nr_entries == 0 or unconditionally.

The following series cleans that up by:

    1) Removing the ULONG_MAX termination in the architecture code

    2) Removing the ULONG_MAX fixups at the call sites

    3) Providing plain storage array based interfaces for stacktrace and
       stackdepot.

    4) Cleaning up the mess at the callsites including some related
       cleanups.

    5) Removing the struct stack_trace based interfaces

This is not changing the struct stack_trace interfaces at the architecture
level, but it removes the exposure to the generic code.

It's only lightly tested as I'm traveling and access to my test boxes is
limited.

Thanks,

	tglx

8<-----------------
 arch/um/kernel/stacktrace.c                   |    2 
 b/arch/arm/kernel/stacktrace.c                |    6 -
 b/arch/arm64/kernel/stacktrace.c              |    4 
 b/arch/parisc/kernel/stacktrace.c             |    5 -
 b/arch/riscv/kernel/stacktrace.c              |    2 
 b/arch/s390/kernel/stacktrace.c               |    6 -
 b/arch/sh/kernel/stacktrace.c                 |    4 
 b/arch/unicore32/kernel/stacktrace.c          |    2 
 b/arch/x86/kernel/stacktrace.c                |   14 --
 drivers/gpu/drm/drm_mm.c                      |   27 +----
 drivers/gpu/drm/i915/i915_vma.c               |   11 --
 drivers/gpu/drm/i915/intel_runtime_pm.c       |   25 +----
 drivers/md/dm-bufio.c                         |   15 +--
 drivers/md/persistent-data/dm-block-manager.c |   19 +--
 fs/btrfs/ref-verify.c                         |   15 ---
 fs/proc/base.c                                |   18 +--
 include/linux/ftrace.h                        |    1 
 include/linux/lockdep.h                       |    9 +
 include/linux/stackdepot.h                    |    8 -
 include/linux/stacktrace.h                    |   40 ++++----
 kernel/backtracetest.c                        |   11 --
 kernel/dma/debug.c                            |   13 +-
 kernel/latencytop.c                           |   29 +----
 kernel/locking/lockdep.c                      |   87 ++++++-----------
 kernel/stacktrace.c                           |  127 ++++++++++++++++++++++----
 kernel/trace/trace.c                          |  103 +++++++++------------
 kernel/trace/trace.h                          |    8 -
 kernel/trace/trace_events_hist.c              |   14 --
 kernel/trace/trace_stack.c                    |   24 +---
 lib/fault-inject.c                            |   12 --
 lib/stackdepot.c                              |   50 +++++-----
 mm/kasan/common.c                             |   33 ++----
 mm/kasan/report.c                             |    7 -
 mm/kmemleak.c                                 |   24 ----
 mm/page_owner.c                               |   82 +++++-----------
 mm/slub.c                                     |   21 +---
 36 files changed, 375 insertions(+), 503 deletions(-)




^ permalink raw reply	[flat|nested] 106+ messages in thread

end of thread, other threads:[~2019-04-14 20:44 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 10:27 [RFC patch 00/41] stacktrace: Avoid the pointless redirection through struct stack_trace Thomas Gleixner
2019-04-10 10:27 ` [RFC patch 01/41] um/stacktrace: Remove the pointless ULONG_MAX marker Thomas Gleixner
2019-04-10 10:27   ` Thomas Gleixner
2019-04-14 20:34   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:27 ` [RFC patch 02/41] x86/stacktrace: " Thomas Gleixner
2019-04-14 20:34   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:27 ` [RFC patch 03/41] arm/stacktrace: " Thomas Gleixner
2019-04-10 10:27   ` Thomas Gleixner
2019-04-14 20:35   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:27 ` [RFC patch 04/41] sh/stacktrace: " Thomas Gleixner
2019-04-10 10:27   ` Thomas Gleixner
2019-04-14 20:36   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:27 ` [RFC patch 05/41] unicore32/stacktrace: " Thomas Gleixner
2019-04-14 20:36   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 06/41] riscv/stacktrace: " Thomas Gleixner
2019-04-10 10:28   ` Thomas Gleixner
2019-04-14 20:37   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 07/41] arm64/stacktrace: " Thomas Gleixner
2019-04-10 10:28   ` Thomas Gleixner
2019-04-14 20:38   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 08/41] parisc/stacktrace: " Thomas Gleixner
2019-04-14 20:38   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 09/41] s390/stacktrace: " Thomas Gleixner
2019-04-14 20:39   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 10/41] lockdep: Remove the ULONG_MAX stack trace hackery Thomas Gleixner
2019-04-14 20:40   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 11/41] mm/slub: " Thomas Gleixner
2019-04-14 20:40   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 12/41] mm/page_owner: " Thomas Gleixner
2019-04-14 20:41   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 13/41] mm/kasan: " Thomas Gleixner
2019-04-10 11:31   ` Dmitry Vyukov
2019-04-10 11:31     ` Dmitry Vyukov
2019-04-14 20:42   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 14/41] latency_top: " Thomas Gleixner
2019-04-14 20:42   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 15/41] drm: " Thomas Gleixner
2019-04-14 20:43   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 16/41] tracing: " Thomas Gleixner
2019-04-11  2:34   ` Josh Poimboeuf
2019-04-11  3:07     ` Steven Rostedt
2019-04-14 20:44   ` [tip:core/stacktrace] " tip-bot for Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 17/41] tracing: Make stack_trace_print() static and rename it Thomas Gleixner
2019-04-10 12:47   ` Steven Rostedt
2019-04-11  0:19     ` AKASHI Takahiro
2019-04-10 10:28 ` [RFC patch 18/41] stacktrace: Provide helpers for common stack trace operations Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 19/41] lib/stackdepot: Provide functions which operate on plain storage arrays Thomas Gleixner
2019-04-10 13:39   ` Alexander Potapenko
2019-04-10 10:28 ` [RFC patch 20/41] backtrace-test: Simplify stack trace handling Thomas Gleixner
2019-04-11  2:47   ` Josh Poimboeuf
2019-04-10 10:28 ` [RFC patch 21/41] proc: Simplify task stack retrieval Thomas Gleixner
2019-04-14 14:49   ` Alexey Dobriyan
2019-04-10 10:28 ` [RFC patch 22/41] latency_top: Simplify stack trace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 23/41] mm/slub: Simplify stack trace retrieval Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 24/41] mm/kmemleak: Simplify stacktrace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 25/41] mm/kasan: " Thomas Gleixner
2019-04-10 11:33   ` Dmitry Vyukov
2019-04-10 11:33     ` Dmitry Vyukov
2019-04-11  2:55   ` Josh Poimboeuf
2019-04-14 16:54     ` Thomas Gleixner
2019-04-14 16:54       ` Thomas Gleixner
2019-04-14 17:00       ` Thomas Gleixner
2019-04-14 17:00         ` Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 26/41] mm/page_owner: Simplify stack trace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 27/41] fault-inject: Simplify stacktrace retrieval Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 28/41] dma/debug: Simplify stracktrace retrieval Thomas Gleixner
2019-04-10 10:28   ` Thomas Gleixner
2019-04-10 11:08   ` Christoph Hellwig
2019-04-10 11:08     ` Christoph Hellwig
2019-04-10 12:08     ` Thomas Gleixner
2019-04-10 12:08       ` Thomas Gleixner
2019-04-10 12:25       ` Steven Rostedt
2019-04-10 12:25         ` Steven Rostedt
2019-04-11 17:21       ` Christoph Hellwig
2019-04-11 17:21         ` Christoph Hellwig
2019-04-11 17:36         ` Steven Rostedt
2019-04-11 17:36           ` Steven Rostedt
2019-04-11 17:44           ` Christoph Hellwig
2019-04-11 17:44             ` Christoph Hellwig
2019-04-11  3:02   ` Josh Poimboeuf
2019-04-11  3:02     ` Josh Poimboeuf
2019-04-11  3:09     ` Steven Rostedt
2019-04-11  3:09       ` Steven Rostedt
2019-04-10 10:28 ` [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval Thomas Gleixner
2019-04-10 11:31   ` Johannes Thumshirn
2019-04-10 12:05     ` Thomas Gleixner
2019-04-10 12:38       ` Johannes Thumshirn
2019-04-10 12:50   ` David Sterba
2019-04-10 13:47   ` Alexander Potapenko
2019-04-10 10:28 ` [RFC patch 30/41] dm bufio: " Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 31/41] dm persistent data: Simplify stack trace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 32/41] drm: Simplify stacktrace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 33/41] lockdep: Remove unused trace argument from print_circular_bug() Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 34/41] lockdep: Move stack trace logic into check_prev_add() Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 35/41] lockdep: Simplify stack trace handling Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 36/41] tracing: Simplify stacktrace retrieval in histograms Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 37/41] tracing: Use percpu stack trace buffer more intelligently Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 38/41] tracing: Make ftrace_trace_userstack() static and conditional Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 39/41] tracing: Simplify stack trace retrieval Thomas Gleixner
2019-04-10 10:28 ` [RFC patch 40/41] stacktrace: Remove obsolete functions Thomas Gleixner
2019-04-11  3:33   ` Josh Poimboeuf
2019-04-11  9:13     ` Peter Zijlstra
2019-04-11 13:00     ` Josh Poimboeuf
2019-04-10 10:28 ` [RFC patch 41/41] lib/stackdepot: " Thomas Gleixner
2019-04-10 13:49   ` Alexander Potapenko
2019-04-10 11:49 ` [RFC patch 00/41] stacktrace: Avoid the pointless redirection through struct stack_trace Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.