Skip to content

Avoid taskstats_exit and sched_process_exit#232

Merged
nicholasberlin merged 1 commit intomainfrom
nberlin/avoid_taskstats_exit
Sep 24, 2025
Merged

Avoid taskstats_exit and sched_process_exit#232
nicholasberlin merged 1 commit intomainfrom
nberlin/avoid_taskstats_exit

Conversation

@nicholasberlin
Copy link
Copy Markdown
Contributor

taskstats_exit can be compiled out based on kernel configuration. Instead use disassociate_ctty(1) as an indication that group_dead has been set. sched_process_exit is called before exit_files, so it's possible that a socket disconnect event could be emitted after a process termination. instead use exit_task_namespaces to emit the exit event. we had little choice in the matter since sched_process_exit is executed before disassociate_ctty, but sched_process_exit was still the incorrect spot to emit an exit event and worth noting.

@nicholasberlin nicholasberlin requested a review from a team as a code owner September 22, 2025 19:57
@nicholasberlin nicholasberlin force-pushed the nberlin/avoid_taskstats_exit branch 3 times, most recently from 8d70ca6 to fb93918 Compare September 23, 2025 11:22
@nicholasberlin nicholasberlin force-pushed the nberlin/avoid_taskstats_exit branch from fb93918 to 45fec0a Compare September 24, 2025 12:05
taskstats_exit can be compiled out based on kernel configuration.
Instead use disassociate_ctty(1) (CONFIG_TTY, hopefully less likely
to be compiled out) as an indication that group_dead has been set.
sched_process_exit is called before exit_files, so it's
possible that a socket disconnect event could be emitted after
a process termination. And, disassociate_ctty is called after.

Remove group_dead tracking.
@nicholasberlin nicholasberlin force-pushed the nberlin/avoid_taskstats_exit branch from 45fec0a to c71a5dc Compare September 24, 2025 12:09
@nicholasberlin
Copy link
Copy Markdown
Contributor Author

nicholasberlin commented Sep 24, 2025

Updated to only use disassociate_ctty and remove group dead tracking.

@nicholasberlin nicholasberlin merged commit ec1ba65 into main Sep 24, 2025
26 checks passed
@nicholasberlin nicholasberlin deleted the nberlin/avoid_taskstats_exit branch September 24, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants