From owner-svn-src-all@FreeBSD.ORG Mon Feb 23 20:38:01 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F226E8CC; Mon, 23 Feb 2015 20:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD512B7C; Mon, 23 Feb 2015 20:38:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1NKc0dO029025; Mon, 23 Feb 2015 20:38:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1NKc04R029024; Mon, 23 Feb 2015 20:38:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201502232038.t1NKc04R029024@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 23 Feb 2015 20:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279217 - head/sys/powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2015 20:38:01 -0000 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); + } }