Commit 7585a63
video: rockchip: mpp: report zero load for idle devices
The per-device statistics shown in /proc/mpp_service/load are only ever
recomputed inside mpp_dev_load(), which is called exclusively from the
task-completion paths (mpp_common.c task worker and the rkvdec2 link/ccu
workers). Within that function the load and utilization figures are only
refreshed when a task finishes *and* at least one load_interval has
elapsed; the result is stored in mpp->load_info and reset for the next
window. There is no timer, runtime-PM hook, or reader-side logic that
ages the value out, so mpp->load_info.load is a snapshot of the last
completed interval, not a live measurement.
As a consequence, once a device stops receiving tasks its stored load is
never updated again and /proc/mpp_service/load keeps reporting the last
busy interval indefinitely (until load_interval is toggled, which clears
the stats via mpp_dev_load_clear()).
This is most visible on the standalone AV1 decoder (fdc70000.av1d). It
is driven one task at a time by the default worker, so when playback
stops the final frame's completion is genuinely the last event that will
ever call mpp_dev_load() for that core, and its load freezes at the busy
value. Multi-core rkvdec2 decoders in link/ccu mode keep draining their
queued task list after playback ends, which happens to log a further,
near-idle interval and pulls the figure back down, so the staleness goes
unnoticed there. The underlying defect is common to every device.
Rather than introduce a periodic recompute (a per-core timer with the
associated runtime-PM interactions), detect the idle case in the reader.
A device whose load_info has not been updated for more than one full
load_interval has, by definition, completed no task in that window and
is idle; report zero for it instead of the stale snapshot. Devices that
never started load tracking (!load_en) are likewise reported as zero.
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 48e2ace commit 7585a63
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
335 | 356 | | |
336 | 357 | | |
337 | | - | |
338 | | - | |
| 358 | + | |
339 | 359 | | |
340 | 360 | | |
341 | 361 | | |
| |||
0 commit comments