Re: [PATCH] exit: add trace_task_exit() tracepoint before current->mm is reset

From: Jiri Olsa
Date: Wed Apr 02 2025 - 06:28:12 EST


On Tue, Apr 01, 2025 at 03:17:01PM -0700, Andrii Nakryiko wrote:
> On Tue, Apr 1, 2025 at 3:12 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> >
> > On Tue, 1 Apr 2025 15:04:11 -0700
> > Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> wrote:
> >
> > > How bad would it be to just move trace_sched_process_exit() then? (and
> > > add group_dead there, as you mentioned)?
> >
> > I personally don't have an issue with that. In fact, the one place I used
> > the sched_process_exit tracepoint, I had to change to use
> > sched_process_free because it does too much after that.
>
> heh, I ran into that as well just recently and also had to use
> sched_process_free instead of sched_process_exit, because between exit
> and free we still can get sched_switch tracepoint trigger (so it's a
> bit too early to clean up whatever per-task state I maintain in BPF
> program).
>
> So yeah, I'm up for that as well, will send v2 just moving and
> extending the existing tracepoint. Thanks!

+1, it'd be great to have the group_dead info, we also need
to have some workarounds for that

thanks,
jirka

>
> >
> > OK, let's just move the sched_process_exit tracepoint. It's in an arbitrary
> > location anyway.
> >
> > -- Steve
>