diff options
| author | Honglei Huang <honghuan@amd.com> | 2026-09-05 21:31:41 +0800 |
|---|---|---|
| committer | Matthew Brost <matthew.brost@intel.com> | 2026-09-07 22:44:00 -0700 |
| commit | 8d242e452ed717055cae14f5d9c3cfb13b4a9c31 (patch) | |
| tree | 3ae2d34eb87f8da4fa2a3f35db0f4a849bbabc68 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 22a81666c2dc098e1ee9e294a13ccdeed5fc248d (diff) | |
| download | linux-8d242e452ed717055cae14f5d9c3cfb13b4a9c31.tar.gz linux-8d242e452ed717055cae14f5d9c3cfb13b4a9c31.zip | |
drm/gpusvm: keep a single DMA mapping inline for THP
drm_gpusvm_get_pages() sizes the dma_addr array for one drm_pagemap_addr
per page, but the mapping loop advances by page order, so a range backed
by one huge page needs a single entry. For a 2 MiB THP that is an 8 KiB
array holding 16 bytes of address.
Union that entry with the array pointer, discriminated by a new
inline_dma_mapping flag. When drm_gpusvm_dma_map_pages() ends up with one
entry it stores it inline and frees the array, after the last error
unwind, which still walks the array form. An unchecked dma_addr read is
now type confusion rather than a compile error, so reads go through the
new drm_gpusvm_pages_first_dma() accessor, including the two
xe_pt_stage_bind() paths.
Only get_pages() and the free path write the union, never the notifier,
and both run under the driver lock that every address reader already
holds. The unlocked short circuit in drm_gpusvm_pages_valid_unlocked()
goes for the same reason: it cannot resolve the union, and every instance
it rejects has to be reset before the allocation loop reuses it.
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Honglei Huang <honghuan@amd.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260905133142.3628027-6-honghuan@amd.com
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
