From owner-freebsd-arch@FreeBSD.ORG Mon Nov 13 21:47:35 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5321216A412; Mon, 13 Nov 2006 21:47:35 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C77C43EEB; Mon, 13 Nov 2006 21:45:41 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 7E0E2170C6; Mon, 13 Nov 2006 21:45:34 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.8/8.13.8) with ESMTP id kADLjYQr007379; Mon, 13 Nov 2006 21:45:34 GMT (envelope-from phk@critter.freebsd.dk) To: Colin Percival From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 13 Nov 2006 13:37:55 PST." <4558E5B3.1000003@freebsd.org> Date: Mon, 13 Nov 2006 21:45:34 +0000 Message-ID: <7378.1163454334@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: arch@freebsd.org Subject: Re: a proposed callout API 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: Mon, 13 Nov 2006 21:47:35 -0000 In message <4558E5B3.1000003@freebsd.org>, Colin Percival writes: >Poul-Henning Kamp wrote: >> XXX_arm(struct xxx*, tick_t, func *, arg *, int flag, struct mtx *); >> Arm timer. > >If we (meaning you) are going to redesign the callout code, I think it >would be great if the API provided some mechanism for specifying the >required callback accuracy; for example "I'd like to be called back no >later than 3 seconds from now, but any time after 2 seconds would be >fine". I thought about something like that, but I fear that the extra math will soak up any advantage there might be for short callouts. For long timeouts, there could be some merit to the argument, if we didn't have tons of short timeouts happening all the time to begin with. But do notice that I plan to run the "slow" callouts only twice per second (to minimize rounding errors). That could actually be a sysctl, so that one could increase the granularity of their execution if so desired. I have added a facility that points the other way: You can get a window in which you should expect your (short) callout to happen. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.