From owner-cvs-all Mon Sep 16 4:10:54 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1905B37B400; Mon, 16 Sep 2002 04:10:53 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CDFB43E42; Mon, 16 Sep 2002 04:10:52 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id g8GBAm0B014466; Mon, 16 Sep 2002 13:10:48 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Harti Brandt Cc: Bruce Evans , Josef Karthauser , "David O'Brien" , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/kern kern_timeout.c In-Reply-To: Your message of "Mon, 16 Sep 2002 12:43:22 +0200." <20020916123330.R92332-100000@beagle.fokus.gmd.de> Date: Mon, 16 Sep 2002 13:10:48 +0200 Message-ID: <14465.1032174648@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20020916123330.R92332-100000@beagle.fokus.gmd.de>, Harti Brandt wri tes: >On Mon, 16 Sep 2002, Poul-Henning Kamp wrote: > >PK>In message <20020916122355.N92332-100000@beagle.fokus.gmd.de>, Harti Brandt wri >PK>tes: >PK> >PK>>In case of the xl driver it is a problem with DELAY(). One xl_mii_readreg >PK>>needs 184 DELAY(1) calls, each of which takes around 9usecs. The mii_tick >PK>>needs several readregs. Just for testing I have converted all these DELAYs >PK>>to use busy wait on the TSC. This cuts down the readreg() time to >PK>>350usecs! >PK> >PK>I have a point on my TODO list about improving DELAY(), but nobody >PK>has picked it up yet. > >Well, Mike Silbersack has pointed me to that TODO entry. Although I have >an oscilloscope and a couple of different machines, its a matter of time. >Its also not a matter of indirecting the DELAY() function to one or two >function pointers - when I used the 'correct' DELAY for the entire xl >driver it failed to attach. The problem is that a number of DELAY(1) calls >assume that the delay is actually larger (see also the hackers discussion >in january) - one would need to go through all DELAY() calls with small >values and check what they are really used for. Well, I would probably rather introduce a new nanosleep(unsigned) function, and convert existing DELAY calls as I go, and retain DELAY to have whatever broken behaviour people expect it to. Then further down the road we can start to bitch about DELAY calls or possibly bulk convert them and deal with the fallout. -- 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message