summaryrefslogtreecommitdiffstats
path: root/sys/dev/xen/blkfront
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-08-11 15:37:02 +0000
committerroyger <royger@FreeBSD.org>2014-08-11 15:37:02 +0000
commit38d76d5727b3a5a71031eb62e04659c0f71e937d (patch)
tree128c6469d19d914a22e2074ae9a1a2d6d1d08788 /sys/dev/xen/blkfront
parent674240e02039a6feb14e2496e939c6cb80df9341 (diff)
downloadFreeBSD-src-38d76d5727b3a5a71031eb62e04659c0f71e937d.zip
FreeBSD-src-38d76d5727b3a5a71031eb62e04659c0f71e937d.tar.gz
blkfront: add support for unmapped IO
Using unmapped IO is really beneficial when running inside of a VM, since it avoids IPIs to other vCPUs in order to invalidate the mappings. This patch adds unmapped IO support to blkfront. The following tests results have been obtained when running on a Xen host without HAP: PVHVM 3165.84 real 6354.17 user 4483.32 sys PVHVM with unmapped IO 2099.46 real 4624.52 user 2967.38 sys This is because when running using shadow page tables TLB flushes and range invalidations are much more expensive, so using unmapped IO provides a very important performance boost. Sponsored by: Citrix Systems R&D Tested by: robak MFC after: 1 week PR: 191173 dev/xen/blkfront/blkfront.c: - Add and announce support for unmapped IO.
Diffstat (limited to 'sys/dev/xen/blkfront')
-rw-r--r--sys/dev/xen/blkfront/blkfront.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 92b5f35..7a1c974 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -272,8 +272,12 @@ xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm)
{
int error;
- error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data,
- cm->cm_datalen, xbd_queue_cb, cm, 0);
+ if (cm->cm_bp != NULL)
+ error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map,
+ cm->cm_bp, xbd_queue_cb, cm, 0);
+ else
+ error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map,
+ cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0);
if (error == EINPROGRESS) {
/*
* Maintain queuing order by freezing the queue. The next
@@ -333,8 +337,6 @@ xbd_bio_command(struct xbd_softc *sc)
}
cm->cm_bp = bp;
- cm->cm_data = bp->bio_data;
- cm->cm_datalen = bp->bio_bcount;
cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno;
switch (bp->bio_cmd) {
@@ -993,7 +995,7 @@ xbd_instance_create(struct xbd_softc *sc, blkif_sector_t sectors,
sc->xbd_disk->d_mediasize = sectors * sector_size;
sc->xbd_disk->d_maxsize = sc->xbd_max_request_size;
- sc->xbd_disk->d_flags = 0;
+ sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO;
if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) {
sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
device_printf(sc->xbd_dev,
OpenPOWER on IntegriCloud