-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelc16.tex
237 lines (201 loc) · 5.75 KB
/
elc16.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Beamer Presentation
% LaTeX Template
% Version 1.0 (10/11/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND THEMES
%----------------------------------------------------------------------------------------
\documentclass{beamer}
\mode<presentation> {
\usetheme{Madrid}
%\setbeamertemplate{footline} % To remove the footer line in all slides uncomment this line
\setbeamertemplate{footline}[page number] % To replace the footer line in all slides with a simple slide count uncomment this line
%\setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line
}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\title[Lessons from Ion]{Lessons from Ion}
\author{Laura Abbott}
\institute[Red Hat]
{
\textit{[email protected]}
\\
\textit{[email protected]}
\\
\textit{[email protected]}
}
\date{April 6, 2016}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
%----------------------------------------------------------------------------------------
% PRESENTATION SLIDES
%----------------------------------------------------------------------------------------
\begin{frame}
\frametitle{Which Ion?}
\begin{itemize}
\item Not the tiling window manager
\item Not the cell phone
\item Not the latest framework Google released
\item Yes, the framework in drivers/staging/android/ion
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Who Am I?}
\begin{itemize}
\item Not the original Ion author
\item Used to crash cell phones
\item Currently crash Fedora
\item "Maintainer" of Ion
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Why?}
\Huge{\centerline{Why am I talking about this?}}
\end{frame}
\begin{frame}
\frametitle{Ion introduction}
\begin{itemize}
\item Need a way to manage memory pools
\item Everyone has a pet framework
\item Ion is consolidated framework
\item Sharing, allocation, mapping
\item Lesson: consolidation is good
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Ion concepts: Heap}
\begin{itemize}
\item Single type of memory
\item Specific carveout region, buddy pages, CMA region etc.
\item bitmask of IDs for allocation
\item allows for fallback depending on system configuration
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Ion concepts: Heap}
\begin{verbatim}
struct ion_allocation_data {
size_t len;
size_t align;
unsigned int heap_id_mask;
unsigned int flags;
ion_user_handle_t handle;
};
#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, \
struct ion_allocation_data)
\end{verbatim}
\end{frame}
\begin{frame}
\frametitle{Heap example: System X}
\begin{itemize}
\item Some mixture of heaps
\item Some IOMMUs, some not
\item Heaps A and B
\item \begin{itemize}
\item Heap A - carveout highest priority
\item Heap B - buddy pages
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Heap example: System Y}
\begin{itemize}
\item Fun new hardware block
\item Requirement: use the memory that was carved out for Heap A
\item Existing heap ID or new heap ID?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Heap example: System Z}
\begin{itemize}
\item Beautiful looking system
\item Beautiful looking hardware errata to work around
\item One errata time n systems = wait where did the bits go?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Heap conclusion}
Lesson: Think about your ABIs. \\
Please make them discoverable
\end{frame}
\begin{frame}
\frametitle{Ion concept: Client}
\begin{itemize}
\item Notion of 'ownership'
\item open("/dev/ion") and kernel APIs
\item Lesson: existing models are there for a reason
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Sharing}
\begin{itemize}
\item fds for sharing
\item dma\_buf is the generic version
\item Lesson: Take what works!
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Ion concept: buffer/handle}
\begin{itemize}
\item buffer represents a specific allocation
\item handle reference per client
\item Reference counting of everything! \\
\includegraphics[scale=0.5]{ion_handle.png}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Writing correct code is hard}
\begin{itemize}
\item Reference counting is hard to get right for everyone!
\item Still finding race conditions
\item Users need to be able to debug their code (I don't want to debug your code)
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{What did we learn here?}
Lesson: Concurrency is hard \\
Lesson: Think about debugging in the beginning
\end{frame}
\begin{frame}
\frametitle{So}
Do we still need Ion? Does anyone care?
\end{frame}
\begin{frame}
\frametitle{Yes and...}
\begin{itemize}
\item Android?
\item Userspace allocation seems popular
\item Generic allocation framework?
\item Devicetree?
\item Lesson: mainlining takes work. Why are you doing it?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Summary}
\begin{itemize}
\item The kernel has missing pieces, code but think about your goals
\item ABIs are hard
\item Concurrency is hard
\item Debugging is hard
\item Think twice before creating your own model, expand instead
\item Do you care about getting it in mainline?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Questions?}
\Huge{\centerline{Questions?}}
\end{frame}
\end{document}