Add comment about where we need to place this routine, and why.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-08-28 19:27:33 +00:00
parent 43effc8ca8
commit 9754579b01
2 changed files with 12 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {