Testing a simpler inter-domain transport
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:
http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hg
It's unoptimized, but shows some promise. Here are the benchmarks for tcpblast and tbench, on a uniproc 3GHz Pentium 4. I'd appreciate SMP numbers if someone has hardware on hand:
UDP blast: tcpblast -u -s50000 dom0 9999 Current Xen = 254961 KB/s Simple share = 233952 KB/s TCP blast: tcpblast -t -s50000 dom0 9999 Current Xen = 86566.4 KB/s Simple share = 135415 KB/s Bidir tcp load: tbench 10 Current Xen = 31.9551 MB/sec Simple share = 64.2113 MB/sec
It's not plumbed into xenbus, so creating LANs is a manual process, using the dmesg output from the initial creation:
dom0# modprobe ohlan create ohlan: created lan eth1 at address 0x1b6000 domU# modprobe ohlan address=0x1b6000
Feedback welcome!
Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol
Quoted 7 lines · Rusty Russell
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hg
Rusty, could you tell us what this code does???
Thanks.
Hieu
Quoted 10 lines · NAHieu
Quoted 7 lines · Rusty Russell
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hgRusty, could you tell us what this code does???
Strange, there's a README.xen-share file in that dir, but Apache doesn't seem to show it. I've put an explicit index in there now, but here's the README.xen-share file:
Introduction to the Xen Share Code
Goal
----
To produce a simple interdomain transport which has device-like characteristics.
Method
------
We need mapped I/O, interrupts and DMA. For mapped I/O, dom0 explicitly creates "sharable" pages for the devices to use, using the dom0 ops:
DOM0_CREATESHAREDPAGES(num-pages)
- Returns physically contiguous pages as a sharable region. DOM0_DESTROYSHAREDPAGES(pfn)
- Free the shared pages once no domain is referencing them (see below) DOM0_GRANTSHAREDPAGES(domain, pfn)
- Allow this domain access to these shared pages.
These are mapped by the domain using the multiplexed "share_op" hypercall:
XEN_SHARE_get(pfn,evtchn)
- Returns a non-negative lowest-possible "peer id". The evtchn is used to notify of all events which occur on this region. The pages can then be mapped.
XEN_SHARE_drop(pfn)
- Drops the shared pages.
We have a method of receiving and sending notifications, based on addresses within the shared region:
XEN_SHARE_watch(address, u32 *decaddr)
- When someone triggers this address (see below), atomically decrement decaddr: if it hits 0, raise the eventchannel.
XEN_SHARE_trigger(address)
- Trigger any watches on this address (see above).
Finally, there is a method for registering scatter-gather lists for input or output:
XEN_SHARE_sg_register(pfn, read/write, #sgs, sg[], u32 *lenaddr)
- Register an array of machine address/length pairs associated with this share. When it's used (see below), the length will be written at lenaddr, the sg unregistered, and the event channel raised.
XEN_SHARE_sg_unregister(pfn, sg_addr)
- Unregister the scatter-gather list with this first address. XEN_SHARE_sg_xfer(pfn, read/write, peerid, #sgs, sg[])
- Copy from these virtual address/length pairs to this peer associated with this share. Returns the number of bytes actually transferred.
These mechanisms create an efficient and simple way of writing virtual drivers which behave like normal device drivers.
Future optimizations / improvements:
(1) The hypervisor code uses dumb linked lists, which could be arrays and hashes.
(2) The hypervisor currently always copies, but could page-flip. This needs involve guest awareness in the non-shadow-pagetable model (the hypervisor *could* reach in and update the pfn array).
(3) The hypervisor should probably use the smallest possible sg entry.
(4) The entire protocol can be transparently remoted by the hypervisor.
(5) A trusted partition could ask the hypervisor for the sg list details for a domain, which it could then program directly into a device.
(6) The code isn't PAE friendly, and actually hands addresses in some places. These should be fixed.
(7) The decaddr trick is a cute idea for interrupt mitigation, but currently unused and probably unnecessary. It could be turned into a simple "set this to 1".
(8) Perhaps the hypervisor should wake at offset 0 whenever someone drops the share.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol
Quoted 4 lines · Rusty Russell
It's unoptimized, but shows some promise. Here are the benchmarks for tcpblast and tbench, on a uniproc 3GHz Pentium 4. I'd appreciate SMP numbers if someone has hardware on hand:
Quoted 11 lines
UDP blast: tcpblast -u -s50000 dom0 9999 Current Xen = 254961 KB/s Simple share = 233952 KB/s TCP blast: tcpblast -t -s50000 dom0 9999 Current Xen = 86566.4 KB/s Simple share = 135415 KB/s Bidir tcp load: tbench 10 Current Xen = 31.9551 MB/sec Simple share = 64.2113 MB/sec
I imagine the numbers for the Simple share should be pretty similiar for domU to domU right? I also imagine that domU to domU under Current xen should be considerably worse right?
Any idea why there's UDP degradation?
This stuff looks awesome :-)
Regards,
Anthony Liguori
Quoted 11 lines
It's not plumbed into xenbus, so creating LANs is a manual process, using the dmesg output from the initial creation:
dom0# modprobe ohlan create ohlan: created lan eth1 at address 0x1b6000 domU# modprobe ohlan address=0x1b6000Feedback welcome!
Rusty.
Quoted 9 lines · Anthony Liguori
Quoted 3 lines · Rusty Russell
It's unoptimized, but shows some promise. Here are the benchmarks for tcpblast and tbench, on a uniproc 3GHz Pentium 4. I'd appreciate SMP numbers if someone has hardware on hand:
I imagine the numbers for the Simple share should be pretty similiar for domU to domU right? I also imagine that domU to domU under Current xen should be considerably worse right?
Yes. The current driver is a hack, which creates the shared page when invoked (in dom0) with "create" as a module param. However, you can attach as many domUs as you want to that same LAN.
Quoted 1 line
Any idea why there's UDP degradation?
No 8(. I'm going to write a block driver and see what that's like.
I was surprised at how aggressively Xen is switching between domains when an event channel was activated: so much so that we rarely got 32
packets off before the switch. Less aggressive scheduling will
definitely help us, and possibly help the existing drivers.
Quoted 1 line
This stuff looks awesome :-)
Thanks, just fiddling. It'll be interesting to see what changes the PPC guys will need for this.
Cheers!
Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol
Quoted 7 lines · Rusty Russell
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hg
Hum, I tried
hg clone http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hg
and my version fails with a zlib compression error raising an incorrect header check,
Quoted 14 lines
It's unoptimized, but shows some promise. Here are the benchmarks for tcpblast and tbench, on a uniproc 3GHz Pentium 4. I'd appreciate SMP numbers if someone has hardware on hand:
UDP blast: tcpblast -u -s50000 dom0 9999 Current Xen = 254961 KB/s Simple share = 233952 KB/s TCP blast: tcpblast -t -s50000 dom0 9999 Current Xen = 86566.4 KB/s Simple share = 135415 KB/s Bidir tcp load: tbench 10 Current Xen = 31.9551 MB/sec Simple share = 64.2113 MB/sec
Quoted 8 lines
It's not plumbed into xenbus, so creating LANs is a manual process, using the dmesg output from the initial creation:
dom0# modprobe ohlan create ohlan: created lan eth1 at address 0x1b6000 domU# modprobe ohlan address=0x1b6000Feedback welcome!
point to point performances looks good, but I'm starting to worry about
thing like group communication in a large Xen machine, assuming you can run a few dozens domains consurrently, it may be useful to get some efficient muticast based communication mechanism, the shared pages should help in some ways (usuall memory/speed tradeoff though). Did you look at this ?
Daniel
Signature · 3 lines
Daniel Veillard | Red Hat http://redhat.com/ [email protected] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Quoted 7 lines · Daniel Veillard
Quoted 6 lines · Rusty Russell
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:
Quoted 6 lines
Quoted 1 line
http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hgHum, I tried
hg clone http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hgand my version fails with a zlib compression error raising an incorrect header check,
It's a bundle, so you should use:
hg unbundle http://ozlabs.org/~rusty/xen/xen-share-2006-02-07.hg
(Note the updated version).
It'd be cool if clone did the Right Thing here, though... Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol
Quoted 5 lines · Rusty Russell
It's a bundle, so you should use:
hg unbundle http://ozlabs.org/~rusty/xen/xen-share-2006-02-07.hg(Note the updated version).
FWIW, you also need -u here, or at least 'hg update' after unbundling to actually see the changes, analogue to 'hg pull' vs. 'hg pull -u'.
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Quoted 11 lines · Muli Ben-Yehuda
Quoted 5 lines · Rusty Russell
It's a bundle, so you should use:
hg unbundle http://ozlabs.org/~rusty/xen/xen-share-2006-02-07.hg(Note the updated version).
FWIW, you also need -u here, or at least 'hg update' after unbundling to actually see the changes, analogue to 'hg pull' vs. 'hg pull -u'.
Without -u it fails complaining about no repo available, creating a fake
.hg directory it tries to add changesets but aborts with
'unknown base 6b1d39a5!'
Trying to add -u as suggested result in
'hg unbundle: option -u not recognized'
using mercurial-0.7
The bundle doesn't seems able to fully provide a repo state, and without
a repo state it seems unable to unbundle the data. I think mercurial hates me, probably because I still don't really understand how it works internally...
Daniel
Signature · 3 lines
Daniel Veillard | Red Hat http://redhat.com/ [email protected] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Quoted 3 lines · Daniel Veillard
Without -u it fails complaining about no repo available, creating a fake
.hg directory it tries to add changesets but aborts with
'unknown base6b1d39a5!'
Ok, you need to unbundle into an existing Xen mercurial tree (just clone unstable from xenbits). Think of unbundling as applying a set of patches - you need something to apply them to...
Quoted 3 lines
Trying to add -u as suggested result in
'hg unbundle: option -u not recognized'
using mercurial-0.7
Sorry, I think it's new in 0.8. You can always update in a seperate step.
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Quoted 8 lines · Rusty Russell
Quoted 7 lines · Daniel Veillard
Quoted 6 lines · Rusty Russell
Hi all,
I've finally found time to resurrect my "share" code, update it for Xen
3.0 and (with Tony Breeds' help) created a simple LAN driver. You can find the bundle here:
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hgHum, I tried
hg clone http://ozlabs.org/~rusty/xen/xen-share-2006-02-05.hgand my version fails with a zlib compression error raising an incorrect header check,
Hmm, never tried that. Surprised it got anywhere at all.
Quoted 7 lines
It's a bundle, so you should use:
hg unbundle http://ozlabs.org/~rusty/xen/xen-share-2006-02-07.hg(Note the updated version).
It'd be cool if clone did the Right Thing here, though...
Well clone can't in this case, as this isn't a full repo history. But pull could..
We'd have to teach pull/clone to do a preliminary query on a URL to see if it was a bundle.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Quoted 5 lines · Daniel Veillard
Quoted 4 lines · Rusty Russell
dom0# modprobe ohlan create ohlan: created lan eth1 at address 0x1b6000 domU# modprobe ohlan address=0x1b6000
Quoted 7 lines
Quoted 1 line
Feedback welcome!
point to point performances looks good, but I'm starting to worry about
thing like group communication in a large Xen machine, assuming you can run a few dozens domains consurrently, it may be useful to get some efficient muticast based communication mechanism, the shared pages should help in some ways (usuall memory/speed tradeoff though). Did you look at this ?
Yes, you can add other domains to the same lan:
domU2# modprobe ohlan address=0x1b6000
Currently limited to 32 partitions for no particularly good reason. Note that like a real LAN, one badly behaved partition can block communication for the others they share the lan with...
Sorry for the confusion!
Rusty.
Signature · 1 line
ccontrol: http://ozlabs.org/~rusty/ccontrol