svn commit: r245717 - projects/virtio/sys/dev/virtio/balloon
Bryan Venteicher
bryanv at FreeBSD.org
Mon Jan 21 06:53:19 UTC 2013
Author: bryanv
Date: Mon Jan 21 06:53:18 2013
New Revision: 245717
URL: http://svnweb.freebsd.org/changeset/base/245717
Log:
virtio_balloon: Make the softc lock a regular mutex
Since the interrupt hanlder is an ithread, we do not require
a spin lock anymore.
Approved by: grehan (implicit)
Modified:
projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c
Modified: projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c
==============================================================================
--- projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c Mon Jan 21 06:52:01 2013 (r245716)
+++ projects/virtio/sys/dev/virtio/balloon/virtio_balloon.c Mon Jan 21 06:53:18 2013 (r245717)
@@ -127,9 +127,9 @@ CTASSERT(VTBALLOON_PAGES_PER_REQUEST * s
#define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx
#define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \
- "VirtIO Balloon Lock", MTX_SPIN)
-#define VTBALLOON_LOCK(_sc) mtx_lock_spin(VTBALLOON_MTX((_sc)))
-#define VTBALLOON_UNLOCK(_sc) mtx_unlock_spin(VTBALLOON_MTX((_sc)))
+ "VirtIO Balloon Lock", MTX_DEF)
+#define VTBALLOON_LOCK(_sc) mtx_lock(VTBALLOON_MTX((_sc)))
+#define VTBALLOON_UNLOCK(_sc) mtx_unlock(VTBALLOON_MTX((_sc)))
#define VTBALLOON_LOCK_DESTROY(_sc) mtx_destroy(VTBALLOON_MTX((_sc)))
static device_method_t vtballoon_methods[] = {
@@ -234,8 +234,7 @@ vtballoon_detach(device_t dev)
VTBALLOON_LOCK(sc);
sc->vtballoon_flags |= VTBALLOON_FLAG_DETACH;
wakeup_one(sc);
- msleep_spin(sc->vtballoon_kproc, VTBALLOON_MTX(sc),
- "vtbdth", 0);
+ msleep(sc->vtballoon_kproc, VTBALLOON_MTX(sc), 0, "vtbdth", 0);
VTBALLOON_UNLOCK(sc);
sc->vtballoon_kproc = NULL;
@@ -411,7 +410,7 @@ vtballoon_send_page_frames(struct vtball
*/
VTBALLOON_LOCK(sc);
while ((c = virtqueue_dequeue(vq, NULL)) == NULL)
- msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0);
+ msleep(sc, VTBALLOON_MTX(sc), 0, "vtbspf", 0);
VTBALLOON_UNLOCK(sc);
KASSERT(c == vq, ("unexpected balloon operation response"));
@@ -510,7 +509,7 @@ vtballoon_sleep(struct vtballoon_softc *
if (current < desired && timeout == 0)
break;
- msleep_spin(sc, VTBALLOON_MTX(sc), "vtbslp", timeout);
+ msleep(sc, VTBALLOON_MTX(sc), 0, "vtbslp", timeout);
}
VTBALLOON_UNLOCK(sc);
More information about the svn-src-projects
mailing list