All of lore.kernel.org
 help / color / mirror / Atom feed
* Any work on sharing of large multi-page segments?
@ 2015-03-15  8:37 Andrew Warkentin
  2015-03-16 11:49 ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Warkentin @ 2015-03-15  8:37 UTC (permalink / raw)
  To: xen-devel

Has anyone done any work on sharing of large multiple-page segments 
between domains? The current grant table implementation is unsuitable 
for this because it only allows sharing single pages and is limited to a 
relatively small number of entries (and passing large numbers of 
single-page grant references between domains for a segment might get slow).

I am planning to write a paravirtualized OpenGL impelmentation that will 
use a ring buffer for commands and shared memory for passing buffers 
between front end and back end, rather than trying to push everything 
through a socket as VMGL and Chromium do (using sockets to push OpenGL 
buffers between VMs on the same machine is kind of ridiculous when you 
could just use shared memory segments). Something like this pretty much 
requires the ability to grant multi-page segments. The only other option 
I could see would be limiting the backend to running on dom0 (so it can 
use xc_map_foreign_pages), which I don't consider acceptable, since some 
graphics drivers have issues with running on dom0, and I also want to be 
able to run the backend on an arbitrary domU (such as a dedicated 
graphics domain, or passing the graphics card to a Windows domU and 
having other VMs display through it - that's about the only way that I 
know of to have Direct3D support under Windows simultaneously with 
OpenGL on other VMs other than using Wine Direct3D, which is somewhat 
limited).

Another use of segment grants would be sharing of code between driver 
domains to reduce memory footprint. I am wanting to put together a Xen 
system where dom0 is a stub domain (running a single-process embedded 
OS) that just provides xenstore and starts and stops domains (based on 
requests from a domU), and there is a separate domain for each driver 
(based on a cut-down Linux system, and maybe also optionally on the same 
single-process OS as dom0, with the NetBSD rump kernel PCI drivers 
ported to it). Since there will be several service domains, using 
segments to share code between them would reduce the memory footprint 
somewhat (for sharing kernel code these would presumably require some 
kind of small bootstrap to map the grant reference).

If nobody has patched Xen to support multi-page segment grants (I 
couldn't find anything of the sort), I plan to write my own patches. 
Would there be any major limitations of the current design that would 
prevent supporting them without a major redesign? I'd like to add 
support for multiple-page grants in a way that requires as few changes 
to existing DomU code as possible. Maybe a new hypercall that maps a 
multiple-page grant so that existing grant-handling code won't break if 
it attempts to map a multiple-page grant reference, and some kind of 
"grant length table" to allow domains that use v1 grant tables to grant 
multi-page segments (for v2 grant tables, a new type flag and entry 
format could probably be used)?

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

end of thread, other threads:[~2015-03-18 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15  8:37 Any work on sharing of large multi-page segments? Andrew Warkentin
2015-03-16 11:49 ` Jan Beulich
2015-03-17  0:46   ` Andrew Warkentin
2015-03-17  8:54     ` Jan Beulich
2015-03-17 23:45       ` Andrew Warkentin
2015-03-18 10:16         ` Ian Campbell
2015-03-18 16:40         ` George Dunlap
2015-03-17 11:48     ` George Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.