dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gpu/buddy: Per-order free and used block scoreboards
@ 2026-05-04 13:52 Francois Dugast
  2026-05-04 13:52 ` [PATCH 1/2] gpu/buddy: Track per-order free blocks with a scoreboard Francois Dugast
  2026-05-04 13:52 ` [PATCH 2/2] gpu/buddy: Track per-order used " Francois Dugast
  0 siblings, 2 replies; 5+ messages in thread
From: Francois Dugast @ 2026-05-04 13:52 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-xe, matthew.auld, Francois Dugast

drm_buddy_print() currently reports per-order free block counts by
walking all rbtrees, which is O(n) in the total number of free blocks
and holds the allocator lock for the duration. On large VRAM heaps with
many small fragments this becomes expensive.

This series replaces the rbtree walk with two lightweight scoreboard
arrays — free_scoreboard and used_scoreboard — indexed by order and
maintained incrementally at the points where block state transitions
occur. The print functions become simple array lookups, and drivers
reading debugfs (/sys/kernel/debug/dri/0/tile0/vram_mm) now get both
free and used counts per order at O(1) cost.

Francois Dugast (2):
  gpu/buddy: Track per-order free blocks with a scoreboard
  gpu/buddy: Track per-order used blocks with a scoreboard

 drivers/gpu/buddy.c         | 60 +++++++++++++++++++++++++------------
 drivers/gpu/drm/drm_buddy.c | 20 ++++---------
 include/linux/gpu_buddy.h   | 15 ++++++++++
 3 files changed, 61 insertions(+), 34 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-08 14:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 13:52 [PATCH 0/2] gpu/buddy: Per-order free and used block scoreboards Francois Dugast
2026-05-04 13:52 ` [PATCH 1/2] gpu/buddy: Track per-order free blocks with a scoreboard Francois Dugast
2026-05-08 14:09   ` Matthew Auld
2026-05-04 13:52 ` [PATCH 2/2] gpu/buddy: Track per-order used " Francois Dugast
2026-05-08 14:13   ` Matthew Auld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox