Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!oliveb!pyramid!prls!mips!djl From: djl@mips.UUCP (Dan Levin) Newsgroups: comp.unix.wizards Subject: Re: Why "u." and not "u->" ? (I'm reading Bach book) Message-ID: <385@winchester.UUCP> Date: Wed, 13-May-87 04:16:35 EDT Article-I.D.: winchest.385 Posted: Wed May 13 04:16:35 1987 Date-Received: Sat, 16-May-87 02:44:50 EDT References: <626@vixie.UUCP> Lines: 31 In article <626@vixie.UUCP>, paul@vixie.UUCP (Paul Vixie Esq) writes: > Mapping the u-area onto 'u.' certainly makes references quicker than using a > structure pointer, since there is one less memory reference before getting to > members of the structure. What I wonder is, how much jumbling is required to > re-map the page, and is the trade-off worth it? Well, since the point of the user area is to contain information not needed unless the process is in core, you have to re-map it when you resume the proc anyway (unless you can share your TLB, and get lucky, and are using your general purpose TLB entries to map the user area). If you have to re-map it, why not always map it to the same virtual addr? In order to avoid a TLB miss on the user struct, we reserve a spot in the TLB for it (since the R2000 TLB is completely under software control, this is done by convention with just a bit of hardware help), and it takes very little time to drop in the new entry ( 9 instructions to be precise, I just looked :-). In answer to the second part, you tend to look in the user struct to find your arguments every time you take a system call (they are loaded there by the entry code), you manipulate the user struct every time you have to lookup an {i|v}node, or do any other of a number of very frequent operations. > Just how much is 'u.' used between context switches, anyway? A whole lot. -- ***dan decwrl!mips!djl mips!djl@decwrl.dec.com