[LEDE-DEV] Xen PVHVM drivers

W. Michael Petullo mike at flyn.org
Tue Jul 11 09:04:13 PDT 2017


>> I have been using OpenWrt to build HVM DomU guests under Xen for some
>> time. From what I can tell, Xen's PVHVM drivers (namely, netfront and
>> blkfront) are not available on my OpenWrt DomU guests, and thus the
>> guests rely on the slower QEMU-based drivers. As a result, the network
>> and disk performance of these DomU guests is not optimal.
>>
>> I did notice that Felix removed the Xen DomU subtarget in January.
>> Would it be possible to return support for Xen's front-end virtual device
>> drivers for use with HVM guests?

> I just checked the last kernel I built for x86/generic (not x86/64)
> and looking at kernel config (inside builddir), I have, by default:
> 
[...]
> CONFIG_XEN_BLKDEV_FRONTEND=y
[...]

Luiz pointed out that some versions of LEDE seem to support the Xen
PVHVM drivers, so I decided to investigate this. I looked at:

x86-17.01.2:    http://downloads.lede-project.org/releases/17.01.2/targets/x86/generic/lede-17.01.2-x86-generic-combined-ext4.img.gz
x86_64-17.01.2: http://downloads.lede-project.org/releases/17.01.2/targets/x86/64/lede-17.01.2-x86-64-combined-ext4.img.gz
x86-master:     http://downloads.lede-project.org/snapshots/targets/x86/generic/lede-x86-generic-combined-ext4.img.gz
x86_64-master:  http://downloads.lede-project.org/snapshots/targets/x86/64/lede-x86-64-combined-ext4.img.gz

Here is what I found:

1. Only x86-master seemed to provide the Xen PVHVM drivers. I checked
this for each build using "dmesg | grep front".

2. There was a drastic difference in write performance between x86-master
and the other builds. For each build, I built a Xen domain using the
following configuration:

name    = "x86"
memory  =  1024
vcpus   =  1
builder = "hvm"
disk    = [ "tap2:tapdisk:aio:/path/to/combined-ext4.img,xvda,w",
            "phy:/dev/mapper/luks-b89e45b3-9b0e-4bf4-965e-918af4085d03,xvdb,w" ]
serial  = "pty"

I then mounted the second disk at /mnt from within the Xen guest and ran
"time dd bs=16k count=131072 if=/dev/zero of=/mnt/test". I ran the test
twice for each build. Here are my measurements:

x86-17.01.2 (QEMU):    3:08 / 2:38
x86_64-17.01.2 (QEMU): 2:23 / 1:57
x86-master (PVHVM):    0:25 / 0:20
x86_64-master (QEMU):  1:54 / 2:02

I realize "dd" is not the best benchmarking tool, but the advantage of
the PVHVM drivers is pretty stark.

In the case of the builds which use QEMU, I did indeed see qemu-dm
working hard on Dom0 while dd ran.

Given this, can we compile the PVHVM drivers into both the x86-generic
and x86_64 builds?

-- 
Mike

:wq



More information about the Lede-dev mailing list