From owner-svn-src-head@freebsd.org Tue Feb 6 23:21:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA85F117B1; Tue, 6 Feb 2018 23:21:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 528E069129; Tue, 6 Feb 2018 23:21:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D85F1EAFC; Tue, 6 Feb 2018 23:21:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16NL84F071352; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NL8ca071351; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802062321.w16NL8ca071351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Feb 2018 23:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328960 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 328960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 23:21:08 -0000 Author: imp Date: Tue Feb 6 23:21:08 2018 New Revision: 328960 URL: https://svnweb.freebsd.org/changeset/base/328960 Log: Keep a counter for number of requests completed with an error. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Feb 6 23:12:47 2018 (r328959) +++ head/sys/cam/cam_iosched.c Tue Feb 6 23:21:08 2018 (r328960) @@ -223,6 +223,7 @@ struct iop_stats { int total; /* Total for all time -- wraps */ int in; /* number queued all time -- wraps */ int out; /* number completed all time -- wraps */ + int errs; /* Number of I/Os completed with error -- wraps */ /* * Statistics on different bits of the process. @@ -781,6 +782,7 @@ cam_iosched_iop_stats_init(struct cam_iosched_softc *i ios->max = ios->current = 300000; ios->min = 1; ios->out = 0; + ios->errs = 0; ios->pending = 0; ios->queued = 0; ios->total = 0; @@ -971,7 +973,11 @@ cam_iosched_iop_stats_sysctl_init(struct cam_iosched_s SYSCTL_ADD_INT(ctx, n, OID_AUTO, "out", CTLFLAG_RD, &ios->out, 0, - "# of transactions completed"); + "# of transactions completed (including with error)"); + SYSCTL_ADD_INT(ctx, n, + OID_AUTO, "errs", CTLFLAG_RD, + &ios->errs, 0, + "# of transactions completed with an error"); SYSCTL_ADD_PROC(ctx, n, OID_AUTO, "limiter", CTLTYPE_STRING | CTLFLAG_RW, @@ -1463,13 +1469,19 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("done: %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_WRITE) { retval = cam_iosched_limiter_iodone(&isc->write_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->write_stats.errs++; isc->write_stats.out++; isc->write_stats.pending--; } else if (bp->bio_cmd == BIO_READ) { retval = cam_iosched_limiter_iodone(&isc->read_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->read_stats.errs++; isc->read_stats.out++; isc->read_stats.pending--; } else if (bp->bio_cmd == BIO_DELETE) { + if (!(bp->bio_flags & BIO_ERROR)) + isc->trim_stats.errs++; isc->trim_stats.out++; isc->trim_stats.pending--; } else if (bp->bio_cmd != BIO_FLUSH) {