mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] gpu/buddy: find range-biased blocks in the free trees
@ 2026-11-09 13:43 William Palacek
  2026-11-09 13:43 ` [PATCH v2 1/2] " William Palacek
  2026-11-09 13:43 ` [PATCH v2 2/2] gpu/tests/buddy: add range-biased allocation performance test William Palacek
  0 siblings, 2 replies; 3+ messages in thread
From: William Palacek @ 2026-11-09 13:43 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-xe, matthew.auld, arunpravin.paneerselvam, joelagnelf,
	sanjay.kumar.yadav, linux-kernel

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 narrows the walk to the highest free block wholly inside the
range, found in the offset-sorted free trees. Patch 2 adds a KUnit test
for the NPS4 pattern (range-biased, cleared, top-down, 64 KiB) that
also checks placement: 1190 ms before, 3 ms after.

v2:
- rebased onto drm-misc-next (single free tree) (Arun)
- take the highest contained block, keeping the walk's top-down
  placement, including for GPU_BUDDY_TOPDOWN_ALLOCATION (Arun)
- the test checks top-down placement
- placement differs from the full walk only for blocks straddling the
  upper range edge and for clear steering across blocks (see patch 1)

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


base-commit: 6f7098738fff3ec7393f924343188cb8e6ebc5d2
-- 
2.43.0


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

end of thread, other threads:[~2026-11-09 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 13:43 [PATCH v2 0/2] gpu/buddy: find range-biased blocks in the free trees William Palacek
2026-11-09 13:43 ` [PATCH v2 1/2] " William Palacek
2026-11-09 13:43 ` [PATCH v2 2/2] gpu/tests/buddy: add range-biased allocation performance test William Palacek

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

all inboxes | Powered by JetHome®