From owner-freebsd-current@FreeBSD.ORG Mon Dec 17 19:28:52 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 995E92C6; Mon, 17 Dec 2012 19:28:52 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 50B7D8FC0C; Mon, 17 Dec 2012 19:28:52 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id CF1B17300A; Mon, 17 Dec 2012 20:27:31 +0100 (CET) Date: Mon, 17 Dec 2012 20:27:31 +0100 From: Luigi Rizzo To: Davide Italiano Subject: regarding r242905 ('us' argument to some callout functions) was Re: [RFC/RFT] calloutng Message-ID: <20121217192731.GA83405@onelab2.iet.unipi.it> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-current , freebsd-arch@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2012 19:28:52 -0000 [addressing the various items separately] On Fri, Dec 14, 2012 at 01:57:36PM +0100, Davide Italiano wrote: > On Fri, Dec 14, 2012 at 7:41 AM, Luigi Rizzo wrote: ... > > - for several functions the only change is the name of an argument > > from "busy" to "us". Can you elaborate the reason for the change, > > and whether "us" means microseconds or the pronoun ?) > > > > Please see r242905 by mav@. i see the goal of this patch is to pass along the amount of time till the next timer. I wonder why the choice is to use (actually, call) the value "microseconds" rather use a bintime or something scaled and with a well defined resolution. In fact looking at the relevant diff http://svnweb.freebsd.org/base/projects/calloutng/sys/kern/kern_clocksource.c?r1=242905&r2=242904&pathrev=242905 cpu_idleclock() actually returns a value that is not even microseconds but 1/(2^20) seconds. The value seems to be ignored right now so it would be a good time to discuss the resolution. I am concerned that at some point (5 years from now perhaps ?) microseconds might start to become too coarse and we would like something with a more fine-grained resolution. On the other hand, for the purposes of this change, we can probably live with an upper limit of some seconds (waking up the machine once per second is not going to kill performance). So i would suggest to make the argument to these functions uint_32 or uint_64 (preferably the same for 32- and 64-bit machines), rename it to something different from 'us' and have at least 28-30 fractional bits to represent a bintime. Right now you are using a bintime with 20 fractional and 11 or 43 bits for the integer part. cheers luigi