[PATCH v4 0/5] drivers: Improve memory management for large object allocations when i915/shmem is used with iommu

Krzysztof Karas <[email protected]> Thu, 23 Jul 2026 10:25:37 +0000
Newsgroups org.freedesktop.lists.intel-gfx,dev.linux.lists.iommu,org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
It was observed that allocating large objects via i915 driver
(igt-gpu-tools/tests/gem_exec_big/single) the folios and their
pages were not handled properly leading to buffer corruptions
during relocations.
Furthermore, using iommu driver in this context would leave
residual mappings in memory that could not be released, hogging
available RAM even after the process ended.

Krzysztof Karas (5):
  drm/i915/gem: Count mapped pages in a folio
  iommu/dma: Catch scatterlist length overflows
  drm/i915/gem: Pull out size validation into a separate function
  drm/i915/gem: Read and shrink memory in a separate function
  drm/i915/gem: Remove iterator and use while loop

 drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 178 ++++++++++++++--------
 drivers/iommu/dma-iommu.c                 |  20 ++-
 2 files changed, 133 insertions(+), 65 deletions(-)

-- 
2.34.1