-
Notifications
You must be signed in to change notification settings - Fork 2
/
slides.tex
executable file
·453 lines (421 loc) · 11 KB
/
slides.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VM Slides
% February 15, 2016
\documentclass[aspectratio=169]{beamer}
\usepackage{./styles/Presentation}
\title{Virtual Memory}
\subtitle{A Project for CS854}
\author[N. Chen, S. Pratt, K. Vaidyanathan]{Nick Chen\\Simon Pratt\\%
Krishna Vaidyanathan}
\institute[UW]{University of Waterloo}
\date{\today}
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
\newcommand{\bn}{\begin{enumerate}}
\newcommand{\en}{\end{enumerate}}
%%% BEGIN DOCUMENT
\begin{document}
\frame[plain]{\titlepage}
\begin{frame}{Abstract}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
In short:
\bi
\pause
\item We propose to study virtual memory!
\ei
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Background: Virtual Memory}
\begin{columns}[T]
\begin{column}{0.3\textwidth}
\includegraphics[scale=0.2]{./figures/Virtual_memory.png}
\end{column}
\begin{column}{0.7\textwidth}
\bi
\item (on x86) Instructions operate on virtual addresses
\pause
\item Data may be stored:
\bi
\pause
\item In physical memory
\pause
\item On disk
\ei
\pause
\item Each process has a page table
\bi
\pause
\item Maps virtual $\rightarrow$ physical addresses
\ei
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
Our proposal has 3 parts:
\bn
\pause
\item {\color<5>{red} Literature Review}
\pause
\item Experimental Design
\pause
\item Implementation
\en
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal: Literature Review}
\begin{columns}[T]
\begin{column}{0.4\textwidth}
We wish to investigate the following operating systems:
\bn
\pause
\item Linux
\pause
\item NetBSD
\pause
\item OpenIndiana\\(Previously Solaris)
\en
\end{column}
\begin{column}{0.6\textwidth}
\pause
For each OS, we wish to answer the following questions:
\bi
\pause
\item How is physical memory managed?
\pause
\item Are there data structures for physical pages, separate from
the page tables?
\pause
\item How are contiguous regions of memory managed?
\pause
\item How is memory freed?
\pause
\bi
\item What happens when the kernel runs out of memory?
\ei
\pause
\item Do they do anything special on Non-Uniform Memory Access
(NUMA) architectures?
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
Our proposal has 3 parts:
\bn
\item Literature Review
\item {\color<2>{red} Experimental Design}
\item Implementation
\en
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal: Experimental Design}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
\bi
\pause
\item Make a \emph{testable} hypothesis based on lit. review
\pause
\item Design \emph{simple} experiments to test this hypothesis
\pause
\item Example:
\bi
\pause
\item Implement data structures from different VMs
\pause
\item Test performance
\ei
\ei
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
Our proposal has 3 parts:
\bn
\item Literature Review
\item Experimental Design
\item {\color<2>{red} Implementation}
\en
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Proposal: Implementation}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
\bi
\pause
\item Optional
\pause
\item Implement a memory management system for KOS
\pause
\item Use findings from:
\bi
\pause
\item Lit review
\pause
\item Experiments
\ei
\ei
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{High-level design}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
Now we'll summarize the VM design of:
\bi
\item Linux
\item NetBSD
\item OpenIndiana
\ei
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{High-level: Linux}
\begin{columns}[T]
\begin{column}{0.4\textwidth}
\bi
\item vm\_area\_struct
\ei
\includegraphics[scale=0.35]{./figures/linux3.png}
\end{column}
\begin{column}{0.6\textwidth}
\includegraphics[scale=0.35]{./figures/linux1.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{High-level: NetBSD}
\begin{columns}[T]
\begin{column}{0.6\textwidth}
\includegraphics[scale=0.35]{./figures/uvm.png}
\end{column}
\begin{column}{0.4\textwidth}
\bi
\pause
\item VM based on:
\bi
\pause
\item 386BSD
\pause
\item 4.4BSD-Lite (Mach)
\ei
\pause
\item Rewritten in 1998 by Chuck Cranor
\bi
\pause
\item UVM (Unified(?) VM)
\pause
\item 13 page Usenix paper
\pause
\item 270 page PhD dissertation
\ei
\pause
\item Slightly modified in 2001 by Chuck Silvers
\bi
\pause
\item UBC (Unified Buffer Cache)
\pause
\item 5 page Usenix paper
\ei
\pause
\item Minor modifications since then
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{History: OpenIndiana}
\begin{enumerate}
\pause
\item Open source fork of OpenSolaris after Oracle take over
\pause
\item Stewarded by the Illumos Foundation
\end{enumerate}
\end{frame}
\begin{frame}{High-level: OpenIndiana}
\begin{enumerate}
\item Solaris kernel breaks up virtual address space into mappings for each type of memory (eg., heap, stack)
\pause
\item Hardware MMU maps pages to physical memory using platform-specific translation tables
\pause
\item Memory management to manage pages is basically swapping and demand paging
\end{enumerate}
\end{frame}
\begin{frame}{High-level: OpenIndiana}
\begin{center}
\includegraphics[scale=0.25]{./figures/openindiana_mmu.jpg}
\end{center}
\end{frame}
\begin{frame}{High-level: OpenIndiana}
\begin{columns}[T]
\begin{column}{0.7\textwidth}
\includegraphics<1->[scale=0.25]{./figures/page_structure.png}
\end{column}
\begin{column}{0.3\textwidth}
\bi
\item Page table structure different from x86 hardware page table structure
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Differences}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
We have found some significant differences so far:
\bi
\pause
\item What happens when the kernel runs out of memory?
\pause
\item What are the copy-on-write mechanisms?
\ei
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}{What happens when the kernel runs out of memory?}
\begin{columns}[T]
\begin{column}{0.3\textwidth}
Linux:
\bi
\item Start killing processes
\ei
\includegraphics[scale=0.35]{./figures/linux4.png}
\end{column}
\pause
\begin{column}{0.4\textwidth}
NetBSD:
\bi
\item Panic!
\ei
\end{column}
\pause
\begin{column}{0.3\textwidth}
OpenIndiana:
\bi
\item Periodically checks kernel space, and "snaps" data to user space if
kernel space is low
\item If kernel runs out of memory, crashes as far as I can tell
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{What are the copy-on-write mechanisms?}
\begin{columns}[T]
\begin{column}{0.3\textwidth}
Linux:
\bi
\item Page-based copy
\ei
\end{column}
\pause
\begin{column}{0.3\textwidth}
OpenIndiana:
\bi
\item Anonymous maps
\ei
\end{column}
\pause
\begin{column}{0.4\textwidth}
NetBSD:
\bi
\item Copied SunOS/Solaris
\ei
\end{column}
\end{columns}
\end{frame}
\begin{frame}{Summary}
\begin{columns}[T]
\begin{column}{0.2\textwidth}
\end{column}
\begin{column}{0.6\textwidth}
\bn
\item Literature Review
\bi
\item High-level design
\item Differences
\ei
\item Experimental Design
\item Implementation
\en
\end{column}
\begin{column}{0.2\textwidth}
\end{column}
\end{columns}
\end{frame}
\begin{frame}[noframenumbering]{References}
\small
\bi
\item UVM dissertation:\\
\url{http://vorpal.math.drexel.edu/course/opsys2/uvm-project/uvm.pdf}
\item UVM paper:\\
{\footnotesize\url{https://www.usenix.org/legacy/event/usenix99/full_papers/cranor/cranor.pdf}}
\item UBC paper:\\
\url{https://www.usenix.org/legacy/publications/library/proceedings/usenix2000/freenix/silvers.html}
\item \textsl{Understanding the Linux Virtual Memory Manager}\\
\url{https://www.kernel.org/doc/gorman/html/understand/index.html}
\item McDougall, Richard, and Jim Mauro. Solaris internals: Solaris 10 and OpenSolaris kernel architecture. Pearson Education, 2006.
\ei
\end{frame}
\begin{frame}[noframenumbering]{Attribution}
\bi
\item Virtual memory diagram by Ehamberg (Own work) [CC BY-SA 3.0 (\tiny\url{http://creativecommons.org/licenses/by-sa/3.0})], via Wikimedia Commons
\item NetBSD data structure diagram from:\\
{\tiny\url{http://usenix.org/legacy/publications/library/proceedings/usenix99/full_papers/cranor/cranor_html/index.html}}
\item Linux vm\_area\_struct source from:\\
\url{https://www.kernel.org/doc/gorman/html/understand/understand007.html}\\
\item Linux data structures diagram from:\\
\url{http://www.embeddedlinux.org.cn/uclinuxchina/Image9.gif}\\
\item Linux OOM diagram from:\\
\url{https://www.kernel.org/doc/gorman/html/understand/understand016.html}
\item Solaris VM diagram:\\McDougall, Richard, and Jim Mauro. Solaris internals: Solaris 10 and
OpenSolaris kernel architecture. Pearson Education, 2006.
\ei
\end{frame}
\begin{frame}[noframenumbering]{License}
\bi
\item These slides are distributed under the creative commons
Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
\item See http://creativecommons.org/licenses/by-sa/4.0/ for details.
\ei
\end{frame}
\end{document}