Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2015 20:38:00 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279217 - head/sys/powerpc/pseries
Message-ID:  <201502232038.t1NKc04R029024@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Mon Feb 23 20:38:00 2015
New Revision: 279217
URL: https://svnweb.freebsd.org/changeset/base/279217

Log:
  Fix race in interrupt handling that could cause IO to hang up under heavy
  load.

Modified:
  head/sys/powerpc/pseries/phyp_vscsi.c

Modified: head/sys/powerpc/pseries/phyp_vscsi.c
==============================================================================
--- head/sys/powerpc/pseries/phyp_vscsi.c	Mon Feb 23 20:36:07 2015	(r279216)
+++ head/sys/powerpc/pseries/phyp_vscsi.c	Mon Feb 23 20:38:00 2015	(r279217)
@@ -931,10 +931,11 @@ vscsi_check_response_queue(struct vscsi_
 
 	mtx_assert(&sc->io_lock, MA_OWNED);
 
-	phyp_hcall(H_VIO_SIGNAL, sc->unit, 0);
-	bus_dmamap_sync(sc->crq_tag, sc->crq_map, BUS_DMASYNC_POSTREAD);
-
 	while (sc->crq_queue[sc->cur_crq].valid != 0) {
+		/* The hypercalls at both ends of this are not optimal */
+		phyp_hcall(H_VIO_SIGNAL, sc->unit, 0);
+		bus_dmamap_sync(sc->crq_tag, sc->crq_map, BUS_DMASYNC_POSTREAD);
+
 		crq = &sc->crq_queue[sc->cur_crq];
 
 		switch (crq->valid) {
@@ -983,9 +984,9 @@ vscsi_check_response_queue(struct vscsi_
 
 		crq->valid = 0;
 		sc->cur_crq = (sc->cur_crq + 1) % sc->n_crqs;
-	};
 
-	bus_dmamap_sync(sc->crq_tag, sc->crq_map, BUS_DMASYNC_PREWRITE);
-	phyp_hcall(H_VIO_SIGNAL, sc->unit, 1);
+		bus_dmamap_sync(sc->crq_tag, sc->crq_map, BUS_DMASYNC_PREWRITE);
+		phyp_hcall(H_VIO_SIGNAL, sc->unit, 1);
+	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502232038.t1NKc04R029024>