Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2013 13:37:44 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257916 - head/sys/dev/isp
Message-ID:  <201311101337.rAADbi6A083102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Nov 10 13:37:44 2013
New Revision: 257916
URL: http://svnweb.freebsd.org/changeset/base/257916

Log:
  Save one more register read per command by not reading rqstoutrp register
  every time.  The purpose of that register is unlikely output queue overflow
  detection, so read it only when its last known (and probably stale now)
  value signals overflow.
  
  This reduces CPU load and lock congestion and rises bottleneck in CTL
  while doing target mode via two 8Gbps ports from 100K to 120K IOPS.

Modified:
  head/sys/dev/isp/isp_library.c

Modified: head/sys/dev/isp/isp_library.c
==============================================================================
--- head/sys/dev/isp/isp_library.c	Sun Nov 10 13:16:28 2013	(r257915)
+++ head/sys/dev/isp/isp_library.c	Sun Nov 10 13:37:44 2013	(r257916)
@@ -322,9 +322,13 @@ isp_destroy_handle(ispsoftc_t *isp, uint
 void *
 isp_getrqentry(ispsoftc_t *isp)
 {
-	isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
-	if (ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp)) == isp->isp_reqodx) {
-		return (NULL);
+	uint32_t next;
+
+	next = ISP_NXT_QENTRY(isp->isp_reqidx, RQUEST_QUEUE_LEN(isp));
+	if (next == isp->isp_reqodx) {
+		isp->isp_reqodx = ISP_READ(isp, isp->isp_rqstoutrp);
+		if (next == isp->isp_reqodx)
+			return (NULL);
 	}
 	return (ISP_QUEUE_ENTRY(isp->isp_rquest, isp->isp_reqidx));
 }



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