linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Emulated coherent graphics memory v2
@ 2019-04-24 12:00 Thomas Hellstrom
  2019-04-24 12:00 ` [PATCH 1/9] mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem v2 Thomas Hellstrom
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Thomas Hellstrom @ 2019-04-24 12:00 UTC (permalink / raw)
  To: Linux-graphics-maintainer, dri-devel
  Cc: Pv-drivers, linux-kernel, Thomas Hellstrom, Andrew Morton,
	Matthew Wilcox, Will Deacon, Peter Zijlstra, Rik van Riel,
	Minchan Kim, Michal Hocko, Huang Ying, Souptick Joarder,
	Jérôme Glisse, Christian König, linux-mm

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 <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: linux-mm@kvack.org

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 0/9] Emulated coherent graphics memory
@ 2019-04-12 16:04 Thomas Hellstrom
  2019-04-12 16:04 ` [PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct Thomas Hellstrom
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Hellstrom @ 2019-04-12 16:04 UTC (permalink / raw)
  To: dri-devel, Linux-graphics-maintainer, linux-kernel
  Cc: Thomas Hellstrom, Andrew Morton, Matthew Wilcox, Will Deacon,
	Peter Zijlstra, Rik van Riel, Minchan Kim, Michal Hocko,
	Huang Ying, Souptick Joarder, Jérôme Glisse,
	Christian König, linux-mm

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.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: linux-mm@kvack.org

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

end of thread, other threads:[~2019-04-29 17:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 12:00 [PATCH 0/9] Emulated coherent graphics memory v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 1/9] mm: Allow the [page|pfn]_mkwrite callbacks to drop the mmap_sem v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 2/9] mm: Add an apply_to_pfn_range interface v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges v2 Thomas Hellstrom
2019-04-27 15:01   ` [PATCH 3/9] mm: Add write-protect and clean utilities for address space ranges v3 Thomas Hellstrom
2019-04-29 17:17     ` Ralph Campbell
2019-04-24 12:00 ` [PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct Thomas Hellstrom
2019-04-24 14:10   ` Koenig, Christian
2019-04-24 14:20     ` Thomas Hellstrom
2019-04-25  8:35       ` Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 5/9] drm/ttm: TTM fault handler helpers v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 6/9] drm/vmwgfx: Implement an infrastructure for write-coherent resources v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 7/9] drm/vmwgfx: Use an RBtree instead of linked list for MOB resources Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 8/9] drm/vmwgfx: Implement an infrastructure for read-coherent resources v2 Thomas Hellstrom
2019-04-24 12:00 ` [PATCH 9/9] drm/vmwgfx: Add surface dirty-tracking callbacks v2 Thomas Hellstrom
  -- strict thread matches above, loose matches on Subject: below --
2019-04-12 16:04 [PATCH 0/9] Emulated coherent graphics memory Thomas Hellstrom
2019-04-12 16:04 ` [PATCH 4/9] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct Thomas Hellstrom
2019-04-13 18:39   ` Koenig, Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).