Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 07:07:38 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288694 - in stable/10/sys/cam: ata scsi
Message-ID:  <201510050707.t9577c3E067329@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 07:07:37 2015
New Revision: 288694
URL: https://svnweb.freebsd.org/changeset/base/288694

Log:
  MFC r277101 (by imp):
  Explain a bit of tricky code dealing with trims and how it prevents
  starvation. These side effects aren't obvious without extremely
  careful study, and are important to do just so.

Modified:
  stable/10/sys/cam/ata/ata_da.c
  stable/10/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ata/ata_da.c
==============================================================================
--- stable/10/sys/cam/ata/ata_da.c	Mon Oct  5 06:56:22 2015	(r288693)
+++ stable/10/sys/cam/ata/ata_da.c	Mon Oct  5 07:07:37 2015	(r288694)
@@ -1797,6 +1797,16 @@ adadone(struct cam_periph *periph, union
 
 			TAILQ_INIT(&queue);
 			TAILQ_CONCAT(&queue, &softc->trim_req.bps, bio_queue);
+			/*
+			 * Normally, the xpt_release_ccb() above would make sure
+			 * that when we have more work to do, that work would
+			 * get kicked off. However, we specifically keep
+			 * trim_running set to 0 before the call above to allow
+			 * other I/O to progress when many BIO_DELETE requests
+			 * are pushed down. We set trim_running to 0 and call
+			 * daschedule again so that we don't stall if there are
+			 * no other I/Os pending apart from BIO_DELETEs.
+			 */
 			softc->trim_running = 0;
 			adaschedule(periph);
 			cam_periph_unlock(periph);

Modified: stable/10/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/10/sys/cam/scsi/scsi_da.c	Mon Oct  5 06:56:22 2015	(r288693)
+++ stable/10/sys/cam/scsi/scsi_da.c	Mon Oct  5 07:07:37 2015	(r288694)
@@ -3048,6 +3048,16 @@ dadone(struct cam_periph *periph, union 
 			TAILQ_INIT(&queue);
 			TAILQ_CONCAT(&queue, &softc->delete_run_queue.queue, bio_queue);
 			softc->delete_run_queue.insert_point = NULL;
+			/*
+			 * Normally, the xpt_release_ccb() above would make sure
+			 * that when we have more work to do, that work would
+			 * get kicked off. However, we specifically keep
+			 * delete_running set to 0 before the call above to
+			 * allow other I/O to progress when many BIO_DELETE
+			 * requests are pushed down. We set delete_running to 0
+			 * and call daschedule again so that we don't stall if
+			 * there are no other I/Os pending apart from BIO_DELETEs.
+			 */
 			softc->delete_running = 0;
 			daschedule(periph);
 			cam_periph_unlock(periph);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510050707.t9577c3E067329>