From 9754579b019c927b6630f9479d3e979acc2626af Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 28 Aug 2017 19:27:33 +0000 Subject: [PATCH] Add comment about where we need to place this routine, and why. Sponsored by: Netflix --- sys/cam/ata/ata_da.c | 6 ++++++ sys/cam/nvme/nvme_da.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 49271b7ea108..5f000e05511c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -2853,6 +2853,12 @@ adadone(struct cam_periph *periph, union ccb *done_ccb) if (softc->outstanding_cmds == 0) softc->flags |= ADA_FLAG_WAS_OTAG; + /* + * We need to call cam_iosched before we call biodone so that we + * don't measure any activity that happens in the completion + * routine, which in the case of sendfile can be quite + * extensive. + */ cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); xpt_release_ccb(done_ccb); if (state == ADA_CCB_TRIM) { diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 0602e8b6f8db..a6da18cee0ba 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1021,6 +1021,12 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb) free(bp->bio_driver2, M_NVMEDA); softc->outstanding_cmds--; + /* + * We need to call cam_iosched before we call biodone so that we + * don't measure any activity that happens in the completion + * routine, which in the case of sendfile can be quite + * extensive. + */ cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); xpt_release_ccb(done_ccb); if (state == NDA_CCB_TRIM) {