Date: Tue, 5 Apr 2016 00:08:42 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297568 - head/sys/dev/fdc Message-ID: <201604050008.u3508gWj068936@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604050008.u3508gWj068936>