Re: [PATCH] taskstats: retain dead thread stats in TGID queries
From: Yiyang Chen
Date: Mon Mar 30 2026 - 14:24:10 EST
Hi Yaxin,
Thanks for the review.
> 1. Capturing the final delay-accounting update before task exit is necessary;
> otherwise, cumulative task delay will be underestimated over time.
Yes, exactly. My patch preserves this behavior — delay accounting was already
being accumulated in fill_tgid_exit() via delayacct_add_tsk(). What I'm doing
is extending this same pattern to other fields (ac_etime, ac_utime, ac_stime,
nvcsw, nivcsw) that were only accumulated for live threads but not for exited
threads, causing data loss in TGID queries.
> 2. For fixes of this kind, it is best to include the issue/bug ID that is being fixed,
> so the change remains clearly traceable.
Thanks. There is no formal issue/bug ID for this problem at the moment.
If needed, I can try to report one and update the patch accordingly.
Thanks,
Yiyang Chen