From owner-freebsd-arch@FreeBSD.ORG Sun Dec 2 15:48:01 2007 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BD2C16A41A for ; Sun, 2 Dec 2007 15:48:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DBAFE13C442 for ; Sun, 2 Dec 2007 15:48:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lB2FhPRA070754; Sun, 2 Dec 2007 08:43:26 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 02 Dec 2007 08:46:48 -0700 (MST) Message-Id: <20071202.084648.-108809549.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <15391.1196547545@critter.freebsd.dk> References: <15391.1196547545@critter.freebsd.dk> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org Subject: Re: New "timeout" api, to replace callout X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 15:48:01 -0000 In message: <15391.1196547545@critter.freebsd.dk> Poul-Henning Kamp writes: : Here is my proposed new timeout API for 8.x. : : The primary objective is to make it possible to have multiple timeout : "providers" of possibly different kind, so that we can have per-cpu : or per-net-stack timeout handing. : : A secondary goal, is to shove the anti-race handling in destruction of : timeouts back into the implemenation, rather than force users to spend : 20+ lines doing that. : : A third goal is to enable deadline scheduling of timeouts using hardware : like HPET when and where we have it. : : Comments in general (only B/W) and pointers to client code of : particular interest is most welcome. >>/* >> * A duration of time, represented in the optimal way for a given provider >> * or family of providers (ie: per cpu). >> */ >>typedef int timeout_time; What does this mean? How do I get one of those? Without a unit associated with this number, it becomes hard to do a "tickless" implementation. Right now we have a well defined unit (1/hz). I worry that without having a way to convert time to this thing that we'll have more trouble writing drivers. Warner