All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] accel/amdxdna: honour the SYNC_BO range
@ 2026-08-11 20:45 Taimuraz Kaitmazov
  2026-08-11 20:45 ` [PATCH 1/3] accel/amdxdna: refuse an I/O memory mapping of an imported BO Taimuraz Kaitmazov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Taimuraz Kaitmazov @ 2026-08-11 20:45 UTC (permalink / raw)
  To: mamin506, lizhi.hou, ogabbay
  Cc: dri-devel, linux-kernel, sumit.semwal, christian.koenig,
	linux-media, linaro-mm-sig, Taimuraz Kaitmazov

SYNC_BO carries an offset and a size, but amdxdna_flush_bo() honours them
only on the vmap path. An imported BO is tested for first and flushes its
whole scatterlist, so a sync costs what the BO is worth rather than what
the caller asked to maintain: on npu4 an imported 64 MiB BO cost 1056 us
to sync at every size from 4 KiB up. Patch 3 reorders the arms so the
vmap path is tried first, and indexes the page-array fallback from the
requested offset.

Reaching an imported BO through vmap needs two things in front of it.
Patch 1 refuses an I/O memory mapping, which the driver currently stores
as if it were an ordinary kernel address; that one stands on its own and
does not depend on the rest of the series, so it can be taken separately
or first. Patch 2 adds a probe that does not log, so that patch 3 does
not make an exporter without a vmap op print on every ioctl; it is a
refactor and does not depend on patch 1 either. Only patch 3 depends on
both: on patch 2 for the probe, and on patch 1 to keep an I/O mapping
out of the flush it adds.

The measurements in patch 3 were taken with the equivalent change in
AMD's out-of-tree xdna-driver, where this merged as #1541. That version
and this one differ in two places, neither of them on the path the
measurement exercises: it carries a second page-array fallback that
mainline has no field for, reached only when the mapping fails and the BO
is neither imported nor shmem backed, and the mapping helper has a
different name. The flush and the helper are otherwise identical. This
version is compile-tested; it has not been booted.

Patch 1 is from inspection rather than a reproducer. The exporter I can
test against is amdgpu, and amdgpu is the case that cannot reach it: it
implements .pin, so a non peer to peer attachment like this driver's
forces the buffer to GTT before anything maps it. Reproducing it needs a
GPU whose exporter has no .pin, which I do not have paired with an NPU
here.

Taimuraz Kaitmazov (3):
  accel/amdxdna: refuse an I/O memory mapping of an imported BO
  accel/amdxdna: add a quiet variant of amdxdna_gem_vmap()
  accel/amdxdna: flush only the requested range in amdxdna_flush_bo

 drivers/accel/amdxdna/amdxdna_gem.c | 53 +++++++++++++++++++++--------
 1 file changed, 38 insertions(+), 15 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-08-11 21:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 20:45 [PATCH 0/3] accel/amdxdna: honour the SYNC_BO range Taimuraz Kaitmazov
2026-08-11 20:45 ` [PATCH 1/3] accel/amdxdna: refuse an I/O memory mapping of an imported BO Taimuraz Kaitmazov
2026-08-11 20:55   ` sashiko-bot
2026-08-11 20:45 ` [PATCH 2/3] accel/amdxdna: add a quiet variant of amdxdna_gem_vmap() Taimuraz Kaitmazov
2026-08-11 20:58   ` sashiko-bot
2026-08-11 20:45 ` [PATCH 3/3] accel/amdxdna: flush only the requested range in amdxdna_flush_bo Taimuraz Kaitmazov
2026-08-11 21:03   ` sashiko-bot

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.