svn commit: r297568 - head/sys/dev/fdc

John Baldwin jhb at FreeBSD.org
Tue Apr 5 00:08:43 UTC 2016


Author: jhb
Date: Tue Apr  5 00:08:42 2016
New Revision: 297568
URL: https://svnweb.freebsd.org/changeset/base/297568

Log:
  Don't wakeup the fdc worker thread once a second when idle.
  
  The fdc worker thread was using a one second timeout while waiting for
  a new bio to arrive or for the device to detach.  However, the driver
  already does a wakeup when queueing a new bio or asking the thread to
  detach, so the timeout only served to waste CPU time waking up the
  thread once a second just so it could go right back to sleep.  Use an
  infinite timeout instead.
  
  Discussed with:	phk
  Sponsored by:	Netflix

Modified:
  head/sys/dev/fdc/fdc.c

Modified: head/sys/dev/fdc/fdc.c
==============================================================================
--- head/sys/dev/fdc/fdc.c	Mon Apr  4 23:55:32 2016	(r297567)
+++ head/sys/dev/fdc/fdc.c	Tue Apr  5 00:08:42 2016	(r297568)
@@ -968,7 +968,7 @@ fdc_worker(struct fdc_data *fdc)
 			fdc->bp = bioq_takefirst(&fdc->head);
 			if (fdc->bp == NULL)
 				msleep(&fdc->head, &fdc->fdc_mtx,
-				    PRIBIO, "-", hz);
+				    PRIBIO, "-", 0);
 		} while (fdc->bp == NULL &&
 		    (fdc->flags & FDC_KTHREAD_EXIT) == 0);
 		mtx_unlock(&fdc->fdc_mtx);


More information about the svn-src-all mailing list