From bret.lambert@gmail.com Fri Aug 29 14:56:05 2014 Delivered-To: david@gwynne.id.au Received: by 10.152.18.199 with SMTP id y7csp152149lad; Thu, 28 Aug 2014 21:56:06 -0700 (PDT) X-Received: by 10.66.136.12 with SMTP id pw12mr12260208pab.71.1409288165782; Thu, 28 Aug 2014 21:56:05 -0700 (PDT) Return-Path: Received: from cvs.openbsd.org (cvs.openbsd.org. [199.185.137.3]) by mx.google.com with ESMTPS id k7si10309796pdl.120.2014.08.28.21.56.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Aug 2014 21:56:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning bret.lambert@gmail.com does not designate 199.185.137.3 as permitted sender) client-ip=199.185.137.3; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning bret.lambert@gmail.com does not designate 199.185.137.3 as permitted sender) smtp.mail=bret.lambert@gmail.com; dkim=pass header.i=@gmail.com Received: from shear.ucar.edu (lists.openbsd.org [192.43.244.163]) by cvs.openbsd.org (8.14.8/8.12.1) with ESMTP id s7T4u39f029297 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=FAIL) for ; Thu, 28 Aug 2014 22:56:03 -0600 (MDT) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by shear.ucar.edu (8.14.8/8.14.8) with ESMTP id s7T57FKI001060 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=FAIL) for ; Thu, 28 Aug 2014 23:07:16 -0600 (MDT) Received: by mail-we0-f174.google.com with SMTP id u57so1670310wes.5 for ; Thu, 28 Aug 2014 21:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=vHfPngHgSQRdS9OMBwqWyectkM+l1dsnlPDgZ1eXLao=; b=JSaEfdjVaUpupPk+mIiMiQAm6Gbv4MKCd3Fuf/A8iajcwUzksSZmKJgpez2DNlZ4ur BKad3gyjv+wP096p8iRUDtWU/iYzsN3/DxPJB2jIrPcqvsSG55zvhU3FxCGFiW0NUT7N tTxPWuX6uCqUgC4AxZTag4WZAcT+kz6K3q0LGcIIum0mnAUK3O72QRU0BEqjF7Cwe6iE 67DaKuaGgqMihxDjH44V2vEGz2piybDKc3YtMQ33nyNW+RxF0Mo465A1gkqR9k/dkT9i Z/v28sNh+mdeMJh1zT0GXOOdMSXVjZ6pC7hkW3Egjshb8sPnxdtZxqip6EDYgVNEmEUG bA3Q== X-Received: by 10.194.82.106 with SMTP id h10mr10813534wjy.37.1409288155754; Thu, 28 Aug 2014 21:55:55 -0700 (PDT) Received: from gmail.com (p4FEE3BC6.dip0.t-ipconnect.de. [79.238.59.198]) by mx.google.com with ESMTPSA id lu12sm43088915wic.4.2014.08.28.21.55.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Aug 2014 21:55:54 -0700 (PDT) Sender: Bret Lambert Date: Fri, 29 Aug 2014 06:55:52 +0200 From: Bret Lambert To: dlg@openbsd.org Subject: mpi taskq conversion Message-ID: <20140829045552.GA24572@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Status: RO Content-Length: 1586 Lines: 60 I've been running this for a few weeks, and haven't seen anything that smacks of disk issues; if you have no objections, I'd like your blessing to get it in after the weekend. - Bert diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index e5c77b0..6c74609 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -225,6 +226,8 @@ mpi_attach(struct mpi_softc *sc) rw_init(&sc->sc_lock, "mpi_lock"); mtx_init(&sc->sc_evt_rescan_mtx, IPL_BIO); + task_set(&sc->sc_evt_rescan, mpi_fc_rescan, sc, NULL); + /* disable interrupts */ mpi_write(sc, MPI_INTR_MASK, MPI_INTR_MASK_REPLY | MPI_INTR_MASK_DOORBELL); @@ -2474,8 +2477,7 @@ mpi_evt_fc_rescan(struct mpi_softc *sc) mtx_leave(&sc->sc_evt_rescan_mtx); if (queue) { - workq_queue_task(NULL, &sc->sc_evt_rescan, 0, - mpi_fc_rescan, sc, NULL); + task_add(systq, &sc->sc_evt_rescan); } } diff --git a/sys/dev/ic/mpivar.h b/sys/dev/ic/mpivar.h index f1acd33..9223779 100644 --- a/sys/dev/ic/mpivar.h +++ b/sys/dev/ic/mpivar.h @@ -17,6 +17,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + /* #define MPI_DEBUG */ #ifdef MPI_DEBUG extern uint32_t mpi_debug; @@ -149,7 +151,7 @@ struct mpi_softc { struct mutex sc_evt_scan_mtx; struct scsi_iohandler sc_evt_scan_handler; - struct workq_task sc_evt_rescan; + struct task sc_evt_rescan; struct mutex sc_evt_rescan_mtx; u_int sc_evt_rescan_sem;