[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250402082718.GU5880@noisy.programming.kicks-ass.net>
Date: Wed, 2 Apr 2025 10:27:18 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andrii Nakryiko <andrii@...nel.org>
Cc: linux-trace-kernel@...r.kernel.org, mingo@...nel.org,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...a.com, mhocko@...nel.org, rostedt@...dmis.org,
oleg@...hat.com, brauner@...nel.org, glider@...gle.com,
mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
akpm@...ux-foundation.org
Subject: Re: [PATCH] exit: add trace_task_exit() tracepoint before
current->mm is reset
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.
Powered by blists - more mailing lists