From owner-svn-src-head@freebsd.org Sun Oct 15 16:18:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3690E46182; Sun, 15 Oct 2017 16:18:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id CE3837EEB8; Sun, 15 Oct 2017 16:18:04 +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 v9FGI349095973; Sun, 15 Oct 2017 16:18:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGI3IV095972; Sun, 15 Oct 2017 16:18:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151618.v9FGI3IV095972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324632 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 324632 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.23 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: Sun, 15 Oct 2017 16:18:05 -0000 Author: imp Date: Sun Oct 15 16:18:03 2017 New Revision: 324632 URL: https://svnweb.freebsd.org/changeset/base/324632 Log: Be nicer on the dump stack by allocating only a ccb_nvmeio rather than a full ccb. This saves a few hundre bytes, which might be important during a crash dump... Sponsored by: Netflix Suggested by: scottl@ Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:17:59 2017 (r324631) +++ head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:18:03 2017 (r324632) @@ -379,7 +379,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical struct cam_periph *periph; struct nda_softc *softc; u_int secsize; - union ccb ccb; + struct ccb_nvmeio nvmeio; struct disk *dp; uint64_t lba; uint32_t count; @@ -399,15 +399,15 @@ ndadump(void *arg, void *virtual, vm_offset_t physical } if (length > 0) { - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_write(softc, &ccb.nvmeio, virtual, lba, length, count); - xpt_polled_action(&ccb); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) printf("Aborting dump due to I/O error.\n"); @@ -417,16 +417,16 @@ ndadump(void *arg, void *virtual, vm_offset_t physical } /* Flush */ - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_flush(softc, &ccb.nvmeio); - xpt_polled_action(&ccb); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_flush(softc, &nvmeio); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) xpt_print(periph->path, "flush cmd failed\n");