The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: William Palacek <William.Palacek@amd.com>
To: <dri-devel@lists.freedesktop.org>
Cc: intel-xe@lists.freedesktop.org,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Arunpravin Paneer Selvam" <Arunpravin.PaneerSelvam@amd.com>,
	"Sanjay Yadav" <sanjay.kumar.yadav@intel.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Christian König" <christian.koenig@amd.com>,
	linux-kernel@vger.kernel.org,
	"William Palacek" <William.Palacek@amd.com>
Subject: [PATCH v3 0/2] gpu/buddy: find range-biased blocks in the free trees
Date: Mon, 16 Nov 2026 11:11:00 -0500	[thread overview]
Message-ID: <cover.1794845083.git.William.Palacek@amd.com> (raw)

A range-restricted allocation walks every split block in the range, so
its cost grows linearly with the number of live allocations there.
amdgpu restricts every VRAM allocation to its memory partition under
NPS2/NPS4, so on MI300X in CPX/NPS4 KFD allocation latency grows with
every live BO, under a VRAM manager lock shared by the compute
partitions.

Patch 1 replaces the walk with an O(log n) lookup in the offset-sorted
free trees, based on Arun's class-aware version of v1; placement is
unchanged. Patch 2 adds a KUnit test for the NPS4 pattern (range-biased,
cleared, top-down, 64 KiB) that also checks placement: 1103 ms before,
2 ms after.

v2: https://patchwork.freedesktop.org/series/178108/
v1: https://patchwork.freedesktop.org/series/176957/

William Palacek (2):
  gpu/buddy: find range-biased blocks in the free trees
  gpu/tests/buddy: add range-biased allocation performance test

 drivers/gpu/buddy.c                | 214 +++++++++++++++++++----------
 drivers/gpu/tests/gpu_buddy_test.c |  27 ++++
 include/linux/gpu_buddy.h          |   1 +
 3 files changed, 172 insertions(+), 70 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-11-16 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:11 William Palacek [this message]
2026-11-16 16:11 ` [PATCH v3 1/2] gpu/buddy: find range-biased blocks in the free trees William Palacek
2026-11-16 16:11 ` [PATCH v3 2/2] gpu/tests/buddy: add range-biased allocation performance test William Palacek

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=cover.1794845083.git.William.Palacek@amd.com \
    --to=william.palacek@amd.com \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.auld@intel.com \
    --cc=sanjay.kumar.yadav@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