All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Palacek <William.Palacek@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <arunpravin.paneerselvam@amd.com>, <christian.koenig@amd.com>,
	<kent.russell@amd.com>, William Palacek <William.Palacek@amd.com>
Subject: [PATCH 0/2] gpu/buddy: make range-biased allocation independent of live blocks
Date: Tue, 27 Oct 2026 10:19:23 -0400	[thread overview]
Message-ID: <cover.1793108566.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 looks up the lowest free block inside the range in the
offset-sorted free trees and restricts the existing walk to that
block's ancestors. Patch 2 adds a KUnit test for the NPS4 pattern
(range-biased, cleared, 64 KiB): about 1 s before, 2 ms after.

This is based on amd-staging-drm-next. drm-misc-next no longer has
separate clear and dirty free trees, so the lookup there needs a
different form and will be handled separately.

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                | 36 ++++++++++++++++++++++++++++++
 drivers/gpu/tests/gpu_buddy_test.c | 25 +++++++++++++++++++++
 2 files changed, 61 insertions(+)

-- 
2.43.0


             reply	other threads:[~2026-10-27 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 14:19 William Palacek [this message]
2026-10-27 14:19 ` [PATCH 1/2] gpu/buddy: find range-biased blocks in the free trees William Palacek
2026-10-27 14:19 ` [PATCH 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.1793108566.git.William.Palacek@amd.com \
    --to=william.palacek@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=kent.russell@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.