public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org, mingo@kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, mhocko@kernel.org, rostedt@goodmis.org,
	oleg@redhat.com, brauner@kernel.org, glider@google.com,
	mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
	akpm@linux-foundation.org
Subject: Re: [PATCH] exit: add trace_task_exit() tracepoint before current->mm is reset
Date: Wed, 2 Apr 2025 10:27:18 +0200	[thread overview]
Message-ID: <20250402082718.GU5880@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250401184021.2591443-1-andrii@kernel.org>

On Tue, Apr 01, 2025 at 11:40:21AM -0700, Andrii Nakryiko wrote:
> It is useful to be able to access current->mm to, say, record a bunch of
> VMA information right before the task exits (e.g., for stack
> symbolization reasons when dealing with short-lived processes that exit
> in the middle of profiling session). We currently do have
> trace_sched_process_exit() in the exit path, but it is called a bit too
> late, after exit_mm() resets current->mm to NULL, which makes it
> unsuitable for inspecting and recording task's mm_struct-related data
> when tracing process lifetimes.
> 
> There is a particularly suitable place, though, right after
> taskstats_exit() is called, but before we do exit_mm(). taskstats
> performs a similar kind of accounting that some applications do with
> BPF, and so co-locating them seems like a good fit.
> 
> Moving trace_sched_process_exit() a bit earlier would solve this problem
> as well, and I'm open to that.

I don't see a problem with moving it.

      parent reply	other threads:[~2025-04-02  8:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 18:40 [PATCH] exit: add trace_task_exit() tracepoint before current->mm is reset Andrii Nakryiko
2025-04-01 21:32 ` Steven Rostedt
2025-04-01 21:34   ` Steven Rostedt
2025-04-02  7:18     ` Michal Hocko
2025-04-01 22:04   ` Andrii Nakryiko
2025-04-01 22:13     ` Steven Rostedt
2025-04-01 22:17       ` Andrii Nakryiko
2025-04-02 10:27         ` Jiri Olsa
2025-04-02  7:20     ` Michal Hocko
2025-04-02 13:58       ` Steven Rostedt
2025-04-02 15:56       ` Andrii Nakryiko
2025-04-02  8:27 ` Peter Zijlstra [this message]

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=20250402082718.GU5880@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=glider@google.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox