Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / share / doc / papers / sysperf / 0.t
1 .\" Copyright (c) 1985 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)0.t 5.1 (Berkeley) 4/17/91
33 .\"
34 .if n .ND
35 .TL
36 Measuring and Improving the Performance of Berkeley UNIX*
37 .sp
38 April 17, 1991
39 .AU
40 Marshall Kirk McKusick,
41 Samuel J. Leffler\(dg,
42 Michael J. Karels
43 .AI
44 Computer Systems Research Group
45 Computer Science Division
46 Department of Electrical Engineering and Computer Science
47 University of California, Berkeley
48 Berkeley, CA  94720
49 .AB
50 .FS
51 * UNIX is a trademark of AT&T Bell Laboratories.
52 .FE
53 .FS
54 \(dg Samuel J. Leffler is currently employed by:
55 Silicon Graphics, Inc.
56 .FE
57 .FS
58 This work was done under grants from
59 the National Science Foundation under grant MCS80-05144,
60 and the Defense Advance Research Projects Agency (DoD) under
61 ARPA Order No. 4031 monitored by Naval Electronic System Command under
62 Contract No. N00039-82-C-0235.
63 .FE
64 The 4.2 Berkeley Software Distribution of 
65 .UX
66 for the VAX\(dd
67 .FS
68 \(dd VAX, MASSBUS, UNIBUS, and DEC are trademarks of
69 Digital Equipment Corporation.
70 .FE
71 had several problems that could severely affect the overall
72 performance of the system.
73 These problems were identified with
74 kernel profiling and system tracing during day to day use.
75 Once potential problem areas had been identified
76 benchmark programs were devised to highlight the bottlenecks.
77 These benchmarks verified that the problems existed and provided
78 a metric against which to validate proposed solutions.
79 This paper examines 
80 the performance problems encountered and describes
81 modifications that have been made
82 to the system since the initial distribution.
83 .PP
84 The changes to the system have consisted of improvements to the
85 performance of the existing facilities,
86 as well as enhancements to the current facilities.
87 Performance improvements in the kernel include cacheing of path name
88 translations, reductions in clock handling and scheduling overhead,
89 and improved throughput of the network subsystem.
90 Performance improvements in the libraries and utilities include replacement of
91 linear searches of system databases with indexed lookup,
92 merging of most network services into a single daemon,
93 and conversion of system utilities to use the more efficient
94 facilities available in 4.2BSD.
95 Enhancements in the kernel include the addition of subnets and gateways,
96 increases in many kernel limits,
97 cleanup of the signal and autoconfiguration implementations,
98 and support for windows and system logging.
99 Functional extensions in the libraries and utilities include
100 the addition of an Internet name server,
101 new system management tools,
102 and extensions to \fIdbx\fP to work with Pascal.
103 The paper concludes with a brief discussion of changes made to
104 the system to enhance security.
105 All of these enhancements are present in Berkeley UNIX 4.3BSD.
106 .AE
107 .LP
108 .sp 2
109 CR Categories and Subject Descriptors:
110 D.4.3
111 .B "[Operating Systems]":
112 File Systems Management \-
113 .I "file organization, directory structures, access methods";
114 D.4.8
115 .B "[Operating Systems]":
116 Performance \-
117 .I "measurements, operational analysis";
118 .sp
119 Additional Keywords and Phrases:
120 Berkeley UNIX,
121 system performance,
122 application program interface.
123 .sp
124 General Terms:
125 UNIX operating system,
126 measurement,
127 performance.
128 .de PT
129 .lt \\n(LLu
130 .pc %
131 .nr PN \\n%
132 .tl '\\*(LH'\\*(CH'\\*(RH'
133 .lt \\n(.lu
134 ..
135 .af PN i
136 .ds LH Performance
137 .ds RH Contents
138 .bp 1
139 .if t .ds CF April 17, 1991
140 .if t .ds LF DRAFT
141 .if t .ds RF McKusick, et. al.
142 .ce
143 .B "TABLE OF CONTENTS"
144 .LP
145 .sp 1
146 .nf
147 .B "1.  Introduction"
148 .LP
149 .sp .5v
150 .nf
151 .B "2.  Observation techniques
152 \0.1.    System maintenance tools
153 \0.2.    Kernel profiling
154 \0.3.    Kernel tracing
155 \0.4.    Benchmark programs
156 .LP
157 .sp .5v
158 .nf
159 .B "3.  Results of our observations
160 \0.1.    User programs
161 \0.1.1.    Mail system
162 \0.1.2.    Network servers
163 \0.2.    System overhead
164 \0.2.1.    Micro-operation benchmarks
165 \0.2.2.    Path name translation
166 \0.2.3.    Clock processing
167 \0.2.4.    Terminal multiplexors
168 \0.2.5.    Process table management
169 \0.2.6.    File system buffer cache
170 \0.2.7.    Network subsystem
171 \0.2.8.    Virtual memory subsystem
172 .LP
173 .sp .5v
174 .nf
175 .B "4.  Performance Improvements
176 \0.1.    Performance Improvements in the Kernel
177 \0.1.1.    Name Cacheing
178 \0.1.2.    Intelligent Auto Siloing
179 \0.1.3.    Process Table Management
180 \0.1.4.    Scheduling
181 \0.1.5.    Clock Handling
182 \0.1.6.    File System
183 \0.1.7.    Network
184 \0.1.8.    Exec
185 \0.1.9.    Context Switching
186 \0.1.10.   Setjmp and Longjmp
187 \0.1.11.   Compensating for Lack of Compiler Technology
188 \0.2.    Improvements to Libraries and Utilities
189 \0.2.1.    Hashed Databases
190 \0.2.2.    Buffered I/O
191 \0.2.3.    Mail System
192 \0.2.4.    Network Servers
193 \0.2.5.    The C Run-time Library
194 \0.2.6.    Csh
195 .LP
196 .sp .5v
197 .nf
198 .B "5.  Functional Extensions
199 \0.1.    Kernel Extensions
200 \0.1.1.    Subnets, Broadcasts, and Gateways
201 \0.1.2.    Interface Addressing
202 \0.1.3.    User Control of Network Buffering
203 \0.1.4.    Number of File Descriptors
204 \0.1.5.    Kernel Limits
205 \0.1.6.    Memory Management
206 \0.1.7.    Signals
207 \0.1.8.    System Logging
208 \0.1.9.    Windows
209 \0.1.10.   Configuration of UNIBUS Devices
210 \0.1.11.   Disk Recovery from Errors
211 \0.2.    Functional Extensions to Libraries and Utilities
212 \0.2.1.    Name Server
213 \0.2.2.    System Management
214 \0.2.3.    Routing
215 \0.2.4.    Compilers
216 .LP
217 .sp .5v
218 .nf
219 .B "6.  Security Tightening
220 \0.1.    Generic Kernel
221 \0.2.    Security Problems in Utilities
222 .LP
223 .sp .5v
224 .nf
225 .B "7.  Conclusions
226 .LP
227 .sp .5v
228 .nf
229 .B Acknowledgements
230 .LP
231 .sp .5v
232 .nf
233 .B References
234 .LP
235 .sp .5v
236 .nf
237 .B "Appendix \- Benchmark Programs"
238 .de _d
239 .if t .ta .6i 2.1i 2.6i
240 .\" 2.94 went to 2.6, 3.64 to 3.30
241 .if n .ta .84i 2.6i 3.30i
242 ..
243 .de _f
244 .if t .ta .5i 1.25i 2.5i
245 .\" 3.5i went to 3.8i
246 .if n .ta .7i 1.75i 3.8i
247 ..