From owner-svn-src-all@freebsd.org Fri Jan 1 21:50:50 2016 Return-Path: Delivered-To: svn-src-all@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 23F9EA5EDFF; Fri, 1 Jan 2016 21:50:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049E51F89; Fri, 1 Jan 2016 21:50:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 531F4B980; Fri, 1 Jan 2016 16:50:48 -0500 (EST) From: John Baldwin To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r293022 - head/sys/net80211 Date: Fri, 01 Jan 2016 11:50:55 -0800 Message-ID: <5919271.R3YaC4QkYh@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601010021.u010L7sW006625@repo.freebsd.org> References: <201601010021.u010L7sW006625@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 01 Jan 2016 16:50:48 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2016 21:50:50 -0000 On Friday, January 01, 2016 12:21:07 AM Adrian Chadd wrote: > Author: adrian > Date: Fri Jan 1 00:21:07 2016 > New Revision: 293022 > URL: https://svnweb.freebsd.org/changeset/base/293022 > > Log: > [net80211] document the (not completely complete) set of places where > we're assuming hz=1000 and not gracefully handling when it isn't. > > The math involved will return 0 for hz < 1000, which it is on some > platforms and on DragonflyBSD. > > This doesn't fix it, it: > > * converts one manual use over to use the macro, and > * comments where it needs some thought/fixing. > > I'll think about this a bit more before fixing it. > > Submitted by: imre@vdsz.com > > Modified: > head/sys/net80211/ieee80211_freebsd.h > head/sys/net80211/ieee80211_scan_sw.c > head/sys/net80211/ieee80211_var.h > > Modified: head/sys/net80211/ieee80211_scan_sw.c > ============================================================================== > --- head/sys/net80211/ieee80211_scan_sw.c Fri Jan 1 00:16:54 2016 (r293021) > +++ head/sys/net80211/ieee80211_scan_sw.c Fri Jan 1 00:21:07 2016 (r293022) > @@ -641,7 +641,7 @@ scan_task(void *arg, int pending) > * XXX Should use M_TXCB mechanism to eliminate this. > */ > cv_timedwait(&SCAN_PRIVATE(ss)->ss_scan_cv, > - IEEE80211_LOCK_OBJ(ic), hz / 1000); > + IEEE80211_LOCK_OBJ(ic), msecs_to_ticks(1)); It would be better to use SBT_1MS instead with cv_timedwait_sbt(). Especially if the 1 ms is fuzzy you can specify "how" fuzzy it is to permit coalescing of timer interrupts to reduce power usage. This would seem to be especially useful for 802.11 since it is commonly used in devices for which power usage is more impactful. -- John Baldwin