Re: [PATCH v3] exit: move trace_sched_process_exit earlier in do_exit()

From: Andrew Morton
Date: Tue Mar 19 2024 - 17:57:33 EST


On Sun, 10 Mar 2024 13:25:29 +0800 wenyang.linux@xxxxxxxxxxx wrote:

> From: Wen Yang <wenyang.linux@xxxxxxxxxxx>
>
> Currently coredump_task_exit() takes some time to wait for the generation
> of the dump file. But if the user-space wants to receive a notification
> as soon as possible it maybe inconvenient.

If userspace is awaiting this notification to say "it's now OK to read
the dump file" then it could break things?

> Move trace_sched_process_exit() earlier in do_exit().
> This way a user-space monitor could detect the exits and
> potentially make some preparations in advance.
>
> Oleg initially proposed this suggestion, and Steven further provided some
> detailed suggestions, and Mathieu carefully checked the historical code
> and said:
> : I've checked with Matthew Khouzam (maintainer of Trace Compass)
> : which care about this tracepoint, and we have not identified any
> : significant impact of moving it on its model of the scheduler, other
> : than slightly changing its timing.
> : I've also checked quickly in lttng-analyses and have not found
> : any code that care about its specific placement.
> : So I would say go ahead and move it earlier in do_exit(), it's
> : fine by me.

I'm not seeing a clear need for this change. "maybe inconveniant" is
quite thin. Please fully describe what motivated you to work on this?