On 02/12/2026 23:33, Matthew Brost wrote:
Add a bo_defrag debugfs file to inspect the state of the BO
defragmentation worker. It reports whether defrag is supported, the
beneficial page order, the per-run size limit, the current (possibly
backed-off) worker interval along with its default and maximum, whether
the worker is pending (and when it will next run), running or idle, and
the number of BOs on the defrag list.
Each BO on the defrag list is then printed with its size, the number of
bytes still backed below the beneficial order (the bytes a defrag move
would reallocate) and whether it still needs defrag, followed by totals.
A reference to each listed BO is taken under the defrag list lock and
the BO is then locked to sample its backing, as the tt can be torn down
while the BO is still on the list. The per-BO output is therefore a
best-effort snapshot.
Cc: Carlos Santa <[email protected]>
Cc: Ryan Neph <[email protected]>
Cc: Matthew Auld <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Natalie Vock <[email protected]>
Cc: Arun Pravin <[email protected]>
Signed-off-by: Matthew Brost <[email protected]>
Reviewed-by: Matthew Auld <[email protected]>