From owner-freebsd-hackers Thu Jul 2 06:29:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20662 for freebsd-hackers-outgoing; Thu, 2 Jul 1998 06:29:51 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id GAA20640; Thu, 2 Jul 1998 06:29:33 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id NAA12433; Thu, 2 Jul 1998 13:59:19 +0200 From: Luigi Rizzo Message-Id: <199807021159.NAA12433@labinfo.iet.unipi.it> Subject: Re: timeout granularity (was: Re: Console driver...) To: smoergrd@oslo.geco-prakla.slb.com (Dag-Erling Coidan Smørgrav) Date: Thu, 2 Jul 1998 13:59:19 +0200 (MET DST) Cc: sos@FreeBSD.ORG, nick.hibma@jrc.it, hackers@FreeBSD.ORG In-Reply-To: from "Dag-Erling Coidan Smørgrav" at Jul 2, 98 03:10:54 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > the code might check if HZ is set to a suitable value (how large, > > e.g. 1000 or 2000, i have no idea) and use timeout instead of > > polling if the test is successful. Sooner or later hopefully we > > will move to large values of HZ anyways. > > > > (or, how about adding a utimeout() call to the kernel :) > > It's not that simple. You have to know how long to wait, which is > practically impossible to do without hooking the timer interrupt and > reprogramming it to keep pace with the retrace, and even that is > difficult to achieve without a little busy-waiting here and there. a little busy waiting is not a lot. What is bad is 10ms waiting (I hope interrupts are enabled while waiting!) If one can, say, assume that the vertical retrace is never less than 1ms, then HZ=2000 should do the job (wakeup at every tick...). cheers -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message