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

2025-04-05 Thread Jiri Olsa
On Tue, Apr 01, 2025 at 03:17:01PM -0700, Andrii Nakryiko wrote: > On Tue, Apr 1, 2025 at 3:12 PM Steven Rostedt wrote: > > > > On Tue, 1 Apr 2025 15:04:11 -0700 > > Andrii Nakryiko wrote: > > > > > How bad would it be to just move trace_sched_process_exit() then? (and > > > add group_dead there,

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

2025-04-05 Thread Peter Zijlstra
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 pro

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

2025-04-02 Thread Andrii Nakryiko
On Wed, Apr 2, 2025 at 12:20 AM Michal Hocko wrote: > > On Tue 01-04-25 15:04:11, Andrii Nakryiko wrote: > > On Tue, Apr 1, 2025 at 2:31 PM Steven Rostedt wrote: > > > > > > On Tue, 1 Apr 2025 11:40:21 -0700 > > > Andrii Nakryiko wrote: > > > > > > Hi Andrii, > > > > > > > It is useful to be ab

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

2025-04-02 Thread Steven Rostedt
On Wed, 2 Apr 2025 09:20:37 +0200 Michal Hocko wrote: > Is it important to tell the difference between thread and the > whole process group exiting? > > Please keep in mind that even group exit doesn't really imply the mm is > going away (clone allows CLONE_VM without CLONE_SIGNAL - i.e. mm coul

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

2025-04-02 Thread Michal Hocko
On Tue 01-04-25 15:04:11, Andrii Nakryiko wrote: > On Tue, Apr 1, 2025 at 2:31 PM Steven Rostedt wrote: > > > > On Tue, 1 Apr 2025 11:40:21 -0700 > > Andrii Nakryiko wrote: > > > > Hi Andrii, > > > > > It is useful to be able to access current->mm to, say, record a bunch of > > > VMA information

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

2025-04-02 Thread Michal Hocko
On Tue 01-04-25 17:34:16, Steven Rostedt wrote: > On Tue, 1 Apr 2025 17:32:49 -0400 > Steven Rostedt wrote: > > > static void exit_mm(void) > > { > > struct mm_struct *mm = current->mm; > > > > exit_mm_release(current, mm); > > trace_exit_mm(mm); > > > > ?? > > That should have bee

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

2025-04-01 Thread Andrii Nakryiko
On Tue, Apr 1, 2025 at 2:31 PM Steven Rostedt wrote: > > On Tue, 1 Apr 2025 11:40:21 -0700 > Andrii Nakryiko wrote: > > Hi Andrii, > > > 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 rea

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

2025-04-01 Thread Andrii Nakryiko
On Tue, Apr 1, 2025 at 3:12 PM Steven Rostedt wrote: > > On Tue, 1 Apr 2025 15:04:11 -0700 > Andrii Nakryiko 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, th

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

2025-04-01 Thread Steven Rostedt
On Tue, 1 Apr 2025 15:04:11 -0700 Andrii Nakryiko 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 chang

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

2025-04-01 Thread Steven Rostedt
On Tue, 1 Apr 2025 17:32:49 -0400 Steven Rostedt wrote: > static void exit_mm(void) > { > struct mm_struct *mm = current->mm; > > exit_mm_release(current, mm); > trace_exit_mm(mm); > > ?? That should have been: static void exit_mm(void) { struct mm_struct *mm = curre

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

2025-04-01 Thread Steven Rostedt
On Tue, 1 Apr 2025 11:40:21 -0700 Andrii Nakryiko wrote: Hi Andrii, > 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

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

2025-04-01 Thread Andrii Nakryiko
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 e