Date: Mon, 16 Sep 2002 22:03:55 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Harti Brandt <brandt@fokus.gmd.de> Cc: Poul-Henning Kamp <phk@critter.freebsd.dk>, Josef Karthauser <joe@FreeBSD.ORG>, "David O'Brien" <obrien@FreeBSD.ORG>, <cvs-committers@FreeBSD.ORG>, <cvs-all@FreeBSD.ORG> Subject: Re: cvs commit: src/sys/kern kern_timeout.c Message-ID: <20020916214755.K6839-100000@gamplex.bde.org> In-Reply-To: <20020916122355.N92332-100000@beagle.fokus.gmd.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Sep 2002, Harti Brandt wrote: > On Mon, 16 Sep 2002, Poul-Henning Kamp wrote: > > PK>But couldn't some of this be due to evil DELAY() or locking in the > PK>in the timeout routine ? In that case it's only the duration, not > PK>the CPU usage which is .8% ? > > In case of the xl driver it is a problem with DELAY(). One xl_mii_readreg > needs 184 DELAY(1) calls, each of which takes around 9usecs. The mii_tick > needs several readregs. Just for testing I have converted all these DELAYs > to use busy wait on the TSC. This cuts down the readreg() time to > 350usecs! This is quite different from fxp_miibus_readbus() where there is just 1 DELAY(10) call in a loop which is iterated 0 times in the best case. Anything that makes 184 DELAY(1) calls will deservedly suffer from DELAY(1) taking much longer than 1 usec. > IMHO all those status update stuff should rather run from a kernel thread. This would just increase overheads and indeterminacies IMO (unless you have more CPUs than things to do). It can be considered a feature that timeouts are run sequentially on a single CPU. This leaves other CPUs (if any) free to do useful work. Timeout processing just need to be guaranteed to not be delayed by more than N msec or so. You can hope than N < 1000.0 / HZ but probably can't get it (in all cases) when HZ is much larger than the default. The default of 10 msec is very easy to get (although not to guarantee) with modern CPUs provided there are no drivers that busy-wait. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020916214755.K6839-100000>
