svn commit: r306018 - head/sys/geom

Edward Tomasz Napierala trasz at FreeBSD.org
Tue Sep 20 09:18:34 UTC 2016


Author: trasz
Date: Tue Sep 20 09:18:33 2016
New Revision: 306018
URL: https://svnweb.freebsd.org/changeset/base/306018

Log:
  Follow up r305988 by removing g_bio_run_task and related code.
  The g_io_schedule_up() gets its "if" condition swapped to make
  it more similar to g_io_schedule_down().
  
  Suggested by:	mav@
  Reviewed by:	mav@
  MFC after:	1 month

Modified:
  head/sys/geom/geom_io.c

Modified: head/sys/geom/geom_io.c
==============================================================================
--- head/sys/geom/geom_io.c	Tue Sep 20 08:56:50 2016	(r306017)
+++ head/sys/geom/geom_io.c	Tue Sep 20 09:18:33 2016	(r306018)
@@ -69,7 +69,6 @@ static int	g_io_transient_map_bio(struct
 
 static struct g_bioq g_bio_run_down;
 static struct g_bioq g_bio_run_up;
-static struct g_bioq g_bio_run_task;
 
 /*
  * Pace is a hint that we've had some trouble recently allocating
@@ -280,7 +279,6 @@ g_io_init()
 
 	g_bioq_init(&g_bio_run_down);
 	g_bioq_init(&g_bio_run_up);
-	g_bioq_init(&g_bio_run_task);
 	biozone = uma_zcreate("g_bio", sizeof (struct bio),
 	    NULL, NULL,
 	    NULL, NULL,
@@ -887,31 +885,23 @@ void
 g_io_schedule_up(struct thread *tp __unused)
 {
 	struct bio *bp;
+
 	for(;;) {
 		g_bioq_lock(&g_bio_run_up);
-		bp = g_bioq_first(&g_bio_run_task);
-		if (bp != NULL) {
-			g_bioq_unlock(&g_bio_run_up);
-			THREAD_NO_SLEEPING();
-			CTR1(KTR_GEOM, "g_up processing task bp %p", bp);
-			bp->bio_task(bp->bio_task_arg);
-			THREAD_SLEEPING_OK();
-			continue;
-		}
 		bp = g_bioq_first(&g_bio_run_up);
-		if (bp != NULL) {
-			g_bioq_unlock(&g_bio_run_up);
-			THREAD_NO_SLEEPING();
-			CTR4(KTR_GEOM, "g_up biodone bp %p provider %s off "
-			    "%jd len %ld", bp, bp->bio_to->name,
-			    bp->bio_offset, bp->bio_length);
-			biodone(bp);
-			THREAD_SLEEPING_OK();
+		if (bp == NULL) {
+			CTR0(KTR_GEOM, "g_up going to sleep");
+			msleep(&g_wait_up, &g_bio_run_up.bio_queue_lock,
+			    PRIBIO | PDROP, "-", 0);
 			continue;
 		}
-		CTR0(KTR_GEOM, "g_up going to sleep");
-		msleep(&g_wait_up, &g_bio_run_up.bio_queue_lock,
-		    PRIBIO | PDROP, "-", 0);
+		g_bioq_unlock(&g_bio_run_up);
+		THREAD_NO_SLEEPING();
+		CTR4(KTR_GEOM, "g_up biodone bp %p provider %s off "
+		    "%jd len %ld", bp, bp->bio_to->name,
+		    bp->bio_offset, bp->bio_length);
+		biodone(bp);
+		THREAD_SLEEPING_OK();
 	}
 }
 


More information about the svn-src-all mailing list