Skip to content

Emulated coherent graphics memory v2

Thomas Hellstrom dri-devel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem v2mm/memory.c+6 -40 replies
2/9mm: Add an apply_to_pfn_range interface v2include/linux/mm.h mm/memory.c+113 -320 replies
3/9mm: Add write-protect and clean utilities for address space ranges v2MAINTAINERS include/linux/mm.h mm/Kconfig +2 more+310 -10 replies
3/9mm: Add write-protect and clean utilities for address space ranges v3MAINTAINERS include/linux/mm.h mm/Kconfig +2 more+311 -11 reply
4/9drm/ttm: Allow the driver to provide the ttm struct vm_operations_structdrivers/gpu/drm/ttm/ttm_bo.c drivers/gpu/drm/ttm/ttm_bo_vm.c include/drm/ttm/ttm_bo_driver.h+10 -33 replies
5/9drm/ttm: TTM fault handler helpers v2drivers/gpu/drm/ttm/ttm_bo_vm.c include/drm/ttm/ttm_bo_api.h+113 -720 replies
6/9drm/vmwgfx: Implement an infrastructure for write-coherent resources v2drivers/gpu/drm/vmwgfx/Kconfig drivers/gpu/drm/vmwgfx/Makefile drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +8 more+584 -200 replies
7/9drm/vmwgfx: Use an RBtree instead of linked list for MOB resourcesdrivers/gpu/drm/vmwgfx/vmwgfx_bo.c drivers/gpu/drm/vmwgfx/vmwgfx_drv.h drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+32 -160 replies
8/9drm/vmwgfx: Implement an infrastructure for read-coherent resources v2drivers/gpu/drm/vmwgfx/vmwgfx_drv.h drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +2 more+177 -110 replies
9/9drm/vmwgfx: Add surface dirty-tracking callbacks v2drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h drivers/gpu/drm/vmwgfx/vmwgfx_drv.h drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +1 more+600 -70 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchRalph CampbellChristian KönigDeepak Rawat
1/9R-b
2/9R-b
3/9R-b R-b
3/9R-b R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/9] Emulated coherent graphics memory v2

Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver to provide coherent graphics memory, meaning that the GPU sees any content written to the coherent memory on the next GPU operation that touches that memory, and the CPU sees any content written by the GPU to that memory immediately after any fence object trailing the GPU operation has signaled.

Paravirtual drivers that otherwise require explicit synchronization needs to do this by hooking up dirty tracking to pagefault handlers and buffer object validation. This is a first attempt to do that for the vmwgfx driver.

The mm patches has been out for RFC. I think I have addressed all the feedback I got, except a possible softdirty breakage. But although the dirty-tracking and softdirty may write-protect PTEs both care about, that shouldn't really cause any operation interference. In particular since we use the hardware dirty PTE bits and softdirty uses other PTE bits.

For the TTM changes they are hopefully in line with the long-term strategy of making helpers out of what's left of TTM.

The code has been tested and excercised by a tailored version of mesa where we disable all explicit synchronization and assume graphics memory is coherent. The performance loss varies of course; a typical number is around 5%.

Any feedback greatly appreciated.

Changes v1-v2:
- Addressed a number of typos and formatting issues.
- Added a usage warning for apply_to_pfn_range() and apply_to_page_range()
- Re-evaluated the decision to use apply_to_pfn_range() rather than modifying the pagewalk.c. It still looks like generically handling the transparent huge page cases requires the mmap_sem to be held at least in read mode, so sticking with apply_to_pfn_range() for now.
- The TTM page-fault helper vma copy argument was scratched in favour of a pageprot_t argument.

Cc Andrew Morton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Will Deacon <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Huang Ying <[email protected]>
Cc Souptick Joarder <[email protected]>
Cc "Jérôme Glisse" <[email protected]>
Cc "Christian König" <[email protected]>