From owner-freebsd-arch Sun Feb 17 19:53:14 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id E8A4537B400; Sun, 17 Feb 2002 19:53:10 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id OAA01710; Mon, 18 Feb 2002 14:52:52 +1100 Date: Mon, 18 Feb 2002 14:52:51 +1100 (EST) From: Bruce Evans X-X-Sender: To: Terry Lambert Cc: Poul-Henning Kamp , Matthew Dillon , Julian Elischer , Alfred Perlstein , , , , Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday()andcopyout(). Is copyout() MPSAFE on non-i386 archs? ) In-Reply-To: <3C70500B.31282873@mindspring.com> Message-ID: <20020218144148.F4583-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 17 Feb 2002, Terry Lambert wrote: > Bruce Evans wrote: > > I know the synchronization costs for this would be high. They are too > > high even in the kernel, so we skip them for the get*time() family, > > at the cost of getting unsynchronised times. This may be acceptable > > in some applications. The read-only variable in kernel memory has > > similar synchronisation problems. It corresponds fairly directly > > with the variable read by the get*time() family. > > I *know* that it is a significant win to flip-flop the > timecounter context into a reflected user space page > on each and every clock interrupt. That can't be used to implement gettimeofday(). It can only be used to implement the userland equivalants of get_micro[up]time() and get_nano[up]time(). I don't like using these even for stamping file times in seconds in the kernel (though they have more than enough precision for this), since they give times that are incoherent relative to other ways of determining the time. > The benefits to doing this for squid alone, which must > make about 5 gettimeofday() calls per transaction in > order to do "correct" logging (IMO, logging is eye candy, > though some idiots insist on billing based on post > processing log files), are more than significant, they > are a doubling of the transaction rate. Apparently they don't actually look at the timestamps and notice that they (the timestamps) are often the same for different transactions because the timestamps have low resolution. You can fake the increment, but then you can fake the time too. > Crossing protection domains for read-only data which is > frequently accessed is a really, really bad idea. Does it really matter for logging? Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message