Re: [PATCH] delayacct: Preserve delay extrema when aggregating taskstats
From: Andrew Morton
Date: Wed Oct 21 2026 - 19:18:29 EST
On Wed, 21 Oct 2026 01:00:22 +0000 Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
> delayacct_add_tsk() adds each task's statistics to the accumulated TGID
> statistics, but overwrites the delay maxima, minima and peak timestamps.
> Consequently, the last task determines these fields, and a task with no
> recorded delay can erase an earlier task's peak despite a nonzero total.
>
> Keep the largest maximum and its associated timestamp, and combine the
> minima with min_not_zero() since zero denotes an unrecorded delay. Apply
> this to CPU delay and the seven delay types handled by UPDATE_DELAY().
> Single-task queries still start with zeroed statistics and retain the
> task's values.
Looks good, thanks.
To improve understandability it would be useful to include a getdelays
-d -t before/after example in the changelog.