From owner-svn-src-head@freebsd.org Tue Apr 5 00:08:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B77A5B03BDA; Tue, 5 Apr 2016 00:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80B061095; Tue, 5 Apr 2016 00:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3508g8U068937; Tue, 5 Apr 2016 00:08:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3508gWj068936; Tue, 5 Apr 2016 00:08:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604050008.u3508gWj068936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 5 Apr 2016 00:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297568 - head/sys/dev/fdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 00:08:43 -0000 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);