Linux-mm Archive on
 help / color / Atom feed
From: "Thomas Hellström (VMware)" <>
	"Thomas Hellström" <>,
	"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" <>,
	"Christoph Hellwig" <>
Subject: [RFC PATCH 0/7] Emulated coherent graphics memory take 2
Date: Fri, 13 Sep 2019 11:32:06 +0200
Message-ID: <> (raw)

From: Thomas Hellström <>

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.

The mm patch page walk interface has been reworked to be similar to the
reworked page-walk code (mm/pagewalk.c). There have been two other solutions
to consider:
1) Using the page-walk code. That is currently not possible since it requires
the mmap-sem to be held for the struct vm_area_struct vm_flags and for huge
page splitting. The pagewalk code in this patchset can't hold the mmap sems
since it will lead to locking inversion. Instead it uses an operation mode
similar to unmap_mapping_range where the i_mmap_lock is held.
2) Using apply_to_page_range(). The primary use of this code is to fill
page tables. The operation modes are IMO sufficiently different to motivate
re-implementing the page-walk.

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 exercised 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%.

I would like to merge this code through the DRM tree, so an ack to do that
from an mm maintainer would be greatly appreciated.

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

             reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13  9:32 Thomas Hellström (VMware) [this message]
2019-09-13  9:32 ` [RFC PATCH 1/7] mm: Add write-protect and clean utilities for address space ranges Thomas Hellström (VMware)
2019-09-13 11:11   ` Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 2/7] drm/ttm: Allow the driver to provide the ttm struct vm_operations_struct Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 3/7] drm/ttm: TTM fault handler helpers Thomas Hellström (VMware)
2019-09-13 15:18   ` Matthew Wilcox
2019-09-13 16:08     ` Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 4/7] drm/vmwgfx: Implement an infrastructure for write-coherent resources Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 5/7] drm/vmwgfx: Use an RBtree instead of linked list for MOB resources Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 6/7] drm/vmwgfx: Implement an infrastructure for read-coherent resources Thomas Hellström (VMware)
2019-09-13  9:32 ` [RFC PATCH 7/7] drm/vmwgfx: Add surface dirty-tracking callbacks Thomas Hellström (VMware)
2019-09-13 13:40 ` [RFC PATCH 3/7] drm/ttm: TTM fault handler helpers Hillf Danton
2019-09-13 14:34   ` Thomas Hellström (VMware)
2019-09-13 16:23   ` Thomas Hellström (VMware)
2019-09-15  3:34 [RFC PATCH 0/7] Emulated coherent graphics memory take 2 Hillf Danton

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox