From owner-svn-src-all@FreeBSD.ORG Mon Mar 8 16:53:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6731106564A; Mon, 8 Mar 2010 16:53:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4F418FC08; Mon, 8 Mar 2010 16:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28GrwF3050434; Mon, 8 Mar 2010 16:53:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28Grwp2050433; Mon, 8 Mar 2010 16:53:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003081653.o28Grwp2050433@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Mar 2010 16:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204873 - stable/8/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 08 Mar 2010 16:53:58 -0000 Author: mav Date: Mon Mar 8 16:53:58 2010 New Revision: 204873 URL: http://svn.freebsd.org/changeset/base/204873 Log: MFC r204648: Several changes to fix livelock under high load, introduced by r203489: - change the way in which command queue overflow is handled; - do not expose to CAM two command slots, used for driver's internal purposes; - allow driver to use up to 1024 command slots, instead of 256 before. Modified: stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Mon Mar 8 16:23:32 2010 (r204872) +++ stable/8/sys/dev/ciss/ciss.c Mon Mar 8 16:53:58 2010 (r204873) @@ -1353,7 +1353,7 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives >= CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", ndrives, CISS_MAX_LOGICAL); error = ENXIO; @@ -2791,7 +2791,7 @@ ciss_cam_init(struct ciss_softc *sc) * Allocate a devq. We can reuse this for the masked physical * devices if we decide to export these as well. */ - if ((sc->ciss_cam_devq = cam_simq_alloc(sc->ciss_max_requests)) == NULL) { + if ((sc->ciss_cam_devq = cam_simq_alloc(sc->ciss_max_requests - 2)) == NULL) { ciss_printf(sc, "can't allocate CAM SIM queue\n"); return(ENOMEM); } @@ -3065,7 +3065,7 @@ ciss_cam_action_io(struct cam_sim *sim, */ if ((error = ciss_get_request(sc, &cr)) != 0) { xpt_freeze_simq(sim, 1); - csio->ccb_h.status |= CAM_RELEASE_SIMQ; + sc->ciss_flags |= CISS_FLAG_BUSY; csio->ccb_h.status |= CAM_REQUEUE_REQ; return(error); } @@ -3275,6 +3275,13 @@ ciss_cam_complete(struct ciss_request *c ciss_cam_complete_fixup(sc, csio); ciss_release_request(cr); + if (sc->ciss_flags & CISS_FLAG_BUSY) { + sc->ciss_flags &= ~CISS_FLAG_BUSY; + if (csio->ccb_h.status & CAM_RELEASE_SIMQ) + xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0); + else + csio->ccb_h.status |= CAM_RELEASE_SIMQ; + } xpt_done((union ccb *)csio); } Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Mon Mar 8 16:23:32 2010 (r204872) +++ stable/8/sys/dev/ciss/cissvar.h Mon Mar 8 16:53:58 2010 (r204873) @@ -41,7 +41,7 @@ typedef STAILQ_HEAD(, ciss_request) cr_q * commands an adapter may claim to support. Cap it at a reasonable * value. */ -#define CISS_MAX_REQUESTS 256 +#define CISS_MAX_REQUESTS 1024 /* * Maximum number of logical drives we support. @@ -251,6 +251,7 @@ struct ciss_softc #define CISS_FLAG_CONTROL_OPEN (1<<1) /* control device is open */ #define CISS_FLAG_ABORTING (1<<2) /* driver is going away */ #define CISS_FLAG_RUNNING (1<<3) /* driver is running (interrupts usable) */ +#define CISS_FLAG_BUSY (1<<4) /* no free commands */ #define CISS_FLAG_FAKE_SYNCH (1<<16) /* needs SYNCHRONISE_CACHE faked */ #define CISS_FLAG_BMIC_ABORT (1<<17) /* use BMIC command to abort Notify on Event */