public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, matthew.auld@intel.com,
	Francois Dugast <francois.dugast@intel.com>
Subject: [PATCH 0/2] gpu/buddy: Per-order free and used block scoreboards
Date: Mon,  4 May 2026 15:52:40 +0200	[thread overview]
Message-ID: <20260504135343.1797869-1-francois.dugast@intel.com> (raw)

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


             reply	other threads:[~2026-05-04 13:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 13:52 Francois Dugast [this message]
2026-05-04 13:52 ` [PATCH 1/2] gpu/buddy: Track per-order free blocks with a scoreboard Francois Dugast
2026-05-04 22:19   ` Claude review: " Claude Code Review Bot
2026-05-04 13:52 ` [PATCH 2/2] gpu/buddy: Track per-order used " Francois Dugast
2026-05-04 22:19   ` Claude review: " Claude Code Review Bot
2026-05-04 22:19 ` Claude review: gpu/buddy: Per-order free and used block scoreboards Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260504135343.1797869-1-francois.dugast@intel.com \
    --to=francois.dugast@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox