All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>
Subject: [for-next][PATCH 00/10] unwind_deferred: Core infrasrtucture for v6.17
Date: Sat, 26 Jul 2025 10:07:04 -0400	[thread overview]
Message-ID: <20250726140704.560579628@kernel.org> (raw)


This is the core infrastructure for the deferred unwinder that is required
for sframes[1]. Several other patch series is based on this work although
those patch series are not dependent on each other. In order to simplify the
development, having this core series upstream will allow the other series to
be worked on in parallel. The other series are:

- The two patches to implement x86:
  https://lore.kernel.org/linux-trace-kernel/20250717004958.260781923@kernel.org/
  https://lore.kernel.org/linux-trace-kernel/20250717004958.432327787@kernel.org/

- The s390 work:
  https://lore.kernel.org/linux-trace-kernel/20250710163522.3195293-1-jremus@linux.ibm.com/

- The perf work:
  https://lore.kernel.org/linux-trace-kernel/20250718164119.089692174@kernel.org/

- The ftrace work:
  https://lore.kernel.org/linux-trace-kernel/20250424192612.505622711@goodmis.org/

- The sframe work:
  https://lore.kernel.org/linux-trace-kernel/20250717012848.927473176@kernel.org/

And more is on the way.

The core infrastructure adds the following in kernel APIs:

- int unwind_user_faultable(struct unwind_stacktrace *trace);

    Performs a user space stack trace that may fault user pages in.

- int unwind_deferred_init(struct unwind_work *work, unwind_callback_t func);

    Allows a tracer to register with the unwind deferred infrastructure.

- int unwind_deferred_request(struct unwind_work *work, u64 *cookie);

    Used when a tracer request a deferred trace. Can be called from interrupt
    or NMI context.

- void unwind_deferred_cancel(struct unwind_work *work);

    Called by a tracer to unregister from the deferred unwind infrastructure.

- void unwind_deferred_task_exit(struct task_struct *task);

    Called by task exit code to flush any pending unwind requests.

- void unwind_task_init(struct task_struct *task);

    Called by do_fork() to initialize the task struct for the deferred
    unwinder.

- void unwind_task_free(struct task_struct *task);

    Called by do_exit() to free up any resources used by the deferred
    unwinder.

None of the above is actually compiled unless an architecture enables it,
which none currently do.

[1] https://sourceware.org/binutils/wiki/sframe

  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
unwind/for-next

Head SHA1: 2879dee3655de961e4c0d715c36b9c550dd7c2de


Josh Poimboeuf (3):
      unwind_user: Add user space unwinding API with frame pointer support
      unwind_user/deferred: Add unwind cache
      unwind_user/deferred: Add deferred unwinding interface

Steven Rostedt (7):
      unwind_user/deferred: Add unwind_user_faultable()
      unwind_user/deferred: Make unwind deferral requests NMI-safe
      unwind deferred: Use bitmask to determine which callbacks to call
      unwind deferred: Add unwind_completed mask to stop spurious callbacks
      unwind: Add USED bit to only have one conditional on way back to user space
      unwind deferred: Use SRCU unwind_deferred_task_work()
      unwind: Finish up unwind when a task exits

----
 MAINTAINERS                           |   8 +
 arch/Kconfig                          |   7 +
 include/asm-generic/Kbuild            |   1 +
 include/asm-generic/unwind_user.h     |   5 +
 include/linux/entry-common.h          |   2 +
 include/linux/sched.h                 |   5 +
 include/linux/unwind_deferred.h       |  81 ++++++++
 include/linux/unwind_deferred_types.h |  39 ++++
 include/linux/unwind_user.h           |  14 ++
 include/linux/unwind_user_types.h     |  44 +++++
 kernel/Makefile                       |   1 +
 kernel/exit.c                         |   2 +
 kernel/fork.c                         |   4 +
 kernel/unwind/Makefile                |   1 +
 kernel/unwind/deferred.c              | 362 ++++++++++++++++++++++++++++++++++
 kernel/unwind/user.c                  | 128 ++++++++++++
 16 files changed, 704 insertions(+)
 create mode 100644 include/asm-generic/unwind_user.h
 create mode 100644 include/linux/unwind_deferred.h
 create mode 100644 include/linux/unwind_deferred_types.h
 create mode 100644 include/linux/unwind_user.h
 create mode 100644 include/linux/unwind_user_types.h
 create mode 100644 kernel/unwind/Makefile
 create mode 100644 kernel/unwind/deferred.c
 create mode 100644 kernel/unwind/user.c

             reply	other threads:[~2025-07-26 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-26 14:07 Steven Rostedt [this message]
2025-07-26 14:07 ` [for-next][PATCH 01/10] unwind_user: Add user space unwinding API with frame pointer support Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 02/10] unwind_user/deferred: Add unwind_user_faultable() Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 03/10] unwind_user/deferred: Add unwind cache Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 04/10] unwind_user/deferred: Add deferred unwinding interface Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 05/10] unwind_user/deferred: Make unwind deferral requests NMI-safe Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 06/10] unwind deferred: Use bitmask to determine which callbacks to call Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 07/10] unwind deferred: Add unwind_completed mask to stop spurious callbacks Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 08/10] unwind: Add USED bit to only have one conditional on way back to user space Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 09/10] unwind deferred: Use SRCU unwind_deferred_task_work() Steven Rostedt
2025-07-26 14:07 ` [for-next][PATCH 10/10] unwind: Finish up unwind when a task exits Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250726140704.560579628@kernel.org \
    --to=rostedt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.