kernel - Fix SMP race in procfs
[dragonfly.git] / share / doc / papers / kerntune / 0.t
1 .\" Copyright (c) 1984 M. K. McKusick
2 .\" Copyright (c) 1984 The Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\"    may be used to endorse or promote products derived from this software
15 .\"    without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\"     @(#)0.t 1.2 (Berkeley) 11/8/90
30 .\"
31 .EQ
32 delim $$
33 .EN
34 .if n .ND
35 .TL
36 Using gprof to Tune the 4.2BSD Kernel
37 .AU
38 Marshall Kirk McKusick
39 .AI
40 Computer Systems Research Group
41 Computer Science Division
42 Department of Electrical Engineering and Computer Science
43 University of California, Berkeley
44 Berkeley, California  94720
45 .AB
46 This paper describes how the \fIgprof\fP profiler 
47 accounts for the running time of called routines
48 in the running time of the routines that call them.
49 It then explains how to configure a profiling kernel on
50 the 4.2 Berkeley Software Distribution of 
51 .UX
52 for the VAX\(dd
53 .FS
54 \(dd VAX is a trademark of Digital Equipment Corporation.
55 .FE
56 and discusses tradeoffs in techniques for collecting
57 profile data.
58 \fIGprof\fP identifies problems
59 that severely affects the overall performance of the kernel.
60 Once a potential problem areas is identified
61 benchmark programs are devised to highlight the bottleneck.
62 These benchmarks verify that the problem exist and provide
63 a metric against which to validate proposed solutions.
64 Two caches are added to the kernel to alleviate the bottleneck
65 and \fIgprof\fP is used to validates their effectiveness.
66 .AE
67 .LP
68 .de PT
69 .lt \\n(LLu
70 .pc %
71 .nr PN \\n%
72 .tl '\\*(LH'\\*(CH'\\*(RH'
73 .lt \\n(.lu
74 ..
75 .af PN i
76 .ds LH 4.2BSD Performance
77 .ds RH Contents
78 .bp 1
79 .if t .ds CF May 21, 1984
80 .if t .ds LF
81 .if t .ds RF McKusick
82 .ce
83 .B "TABLE OF CONTENTS"
84 .LP
85 .sp 1
86 .nf
87 .B "1.  Introduction"
88 .LP
89 .sp .5v
90 .nf
91 .B "2.  The \fIgprof\fP Profiler"
92 \0.1.    Data Presentation"
93 \0.1.1.   The Flat Profile
94 \0.1.2.   The Call Graph Profile
95 \0.2     Profiling the Kernel
96 .LP
97 .sp .5v
98 .nf
99 .B "3.  Using \fIgprof\fP to Improve Performance
100 \0.1.    Using the Profiler
101 \0.2.    An Example of Tuning
102 .LP
103 .sp .5v
104 .nf
105 .B "4.  Conclusions"
106 .LP
107 .sp .5v
108 .nf
109 .B Acknowledgements
110 .LP
111 .sp .5v
112 .nf
113 .B References
114 .af PN 1
115 .bp 1
116 .de _d
117 .if t .ta .6i 2.1i 2.6i
118 .\" 2.94 went to 2.6, 3.64 to 3.30
119 .if n .ta .84i 2.6i 3.30i
120 ..
121 .de _f
122 .if t .ta .5i 1.25i 2.5i
123 .\" 3.5i went to 3.8i
124 .if n .ta .7i 1.75i 3.8i
125 ..