From owner-svn-src-head@freebsd.org Wed Mar 14 16:44:17 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 27B5783C; Wed, 14 Mar 2018 16:44:17 +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 CDAB56A1CF; Wed, 14 Mar 2018 16:44:16 +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 C48262427; Wed, 14 Mar 2018 16:44:16 +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 w2EGiGll046072; Wed, 14 Mar 2018 16:44:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EGiGbx046071; Wed, 14 Mar 2018 16:44:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803141644.w2EGiGbx046071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 14 Mar 2018 16:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330931 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 330931 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: Wed, 14 Mar 2018 16:44:17 -0000 Author: imp Date: Wed Mar 14 16:44:16 2018 New Revision: 330931 URL: https://svnweb.freebsd.org/changeset/base/330931 Log: Allow NULL ccb to cam_iosched_bio_complete When the ccb is NULL to cam_iosched_bio_complete, just update the other statistics, but not the time. If many operations are collapsed together, this is needed to keep stats properly for the grouped bp. This should fix trim accounting. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Wed Mar 14 16:16:25 2018 (r330930) +++ head/sys/cam/cam_iosched.c Wed Mar 14 16:44:16 2018 (r330931) @@ -1493,7 +1493,7 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("Completing command with bio_cmd == %#x\n", bp->bio_cmd); } - if (!(bp->bio_flags & BIO_ERROR)) + if (!(bp->bio_flags & BIO_ERROR) && done_ccb != NULL) cam_iosched_io_metric_update(isc, cam_iosched_sbintime_t(done_ccb->ccb_h.qos.periph_data), bp->bio_cmd, bp->bio_bcount);