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);
+       }
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to