From owner-freebsd-arch@FreeBSD.ORG Tue Mar 5 08:00:58 2013 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 150DED99; Tue, 5 Mar 2013 08:00:58 +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 CFEE5807; Tue, 5 Mar 2013 08:00:57 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 8C1D27300A; Tue, 5 Mar 2013 09:01:34 +0100 (CET) Date: Tue, 5 Mar 2013 09:01:34 +0100 From: Luigi Rizzo To: arch@freebsd.org, Davide Italiano , Alexander Motin Subject: tickless design guidelines Message-ID: <20130305080134.GC13187@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 08:00:58 -0000 Hi, i would like a bit of advice on how to get coarse time estimates (such as "no need to do anything unless at least X msec have elapsed") in a tickless kernel. In the past (and I mean a distant one, i got this habit back in 2.x), rather than calling get*time(), i used to look at "ticks" to see if it had changed, and only fetch the actual time accordingly. This worked well with HZ=1000 or above, when my required accuracy a few milliseconds. With tickless kernels, i am not sure anymore how often ticks gets updated. I may need to do this tests quite frequently (e.g. up to a million times per second), so I'd rather have some lightweight function. Any suggestion ? thanks luigi