summaryrefslogtreecommitdiff
path: root/misc/pres_printk_en.tex
blob: f6e0640e44b5708e597a6609bf458341045449a6 (plain)
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
\input{configpres}
\date{2018-10-25}

\section{printk}

\title{Cleaning Up printk()}
\author{John Ogness}

\maketitle

\newcommand\verbbf[1]{\textcolor[rgb]{0,0,0}{\textbf{#1}}}

\subsection{printk: Issues}

\begin{frame}[containsverbatim]
\begin{itemize}
\item global log buffer protected by \verb|raw_spinlock|
\begin{itemize}
\item disables interrupts
\item not NMI safe
\item not recursive safe
\end{itemize}
\item \verb|printk_safe|
\begin{itemize}
\item relies on \verb|irq_work|
\item bogus timestamps
\end{itemize}
\item console drivers
\begin{itemize}
\item slow (serial, video, netconsole)
\item executed by \verb|printk()| caller (possibly atomic)
\end{itemize}
\item INFO handled the same as EMERG
\begin{itemize}
\item \verb|BUG()| is worth the pain, but ''\verb|USB Video Class driver (1.1.1)|''?
\end{itemize}
\item last \verb|printk()| stuck with the bill
\begin{itemize}
\item it is not unbounded but it is a big wildcard
\end{itemize}
\item \verb|oops_in_progress| and \verb|bust_spinlocks()|
\begin{itemize}
\item um, yeah
\end{itemize}
\end{itemize}
\end{frame}

\subsection{printk: Proposal}

\begin{frame}[containsverbatim]
\begin{itemize}
\item new static global lockless multi-reader multi-writer ring buffer
\begin{itemize}
\item interrupts never disabled
\item NMI safe
\item recursive safe
\item available immediately
\item obsoletes \verb|printk_safe| (log directly from \textbf{any} context)
\end{itemize}
\item grab timestamp as first line of \verb|printk()|
\begin{itemize}
\item accurate timestamps
\end{itemize}
\item create a single \verb|printk| kthread to handle printing to all consoles
\begin{itemize}
\item fully preemptible
\item console driver pain goes away
\end{itemize}
\item introduce a \verb|write_atomic()| operation for consoles
\begin{itemize}
\item optional, NMI safe write implementation
\end{itemize}
\item introduce the concept of ''emergency messages''
\begin{itemize}
\item If a message is flagged for emergency and a console implements \verb|write_atomic()|, print the message for that console \textbf{directly}
\item We are already sitting on the CPU! Use it!
\item \verb|write_atomic()| for UART 8250 implemented as an example
\end{itemize}
\item add CPU ID to output to flag and sort messages
\begin{itemize}
\item simultaneous emergency/non-emergency messages
\item simultaneous emergency messages
\end{itemize}
\end{itemize}
\end{frame}

\subsection{printk: Proposal: Issues}

\begin{frame}[containsverbatim]
\begin{itemize}
\item messages printed out of order
\begin{itemize}
\item but timestamps have meaning
\end{itemize}
\item \verb|LOG_CONT| not yet implemented
\begin{itemize}
\item need to decide how best to implement it
\end{itemize}
\item the new ring buffer does not support dynamic resizing
\begin{itemize}
\item not looked into yet
\end{itemize}
\item vmcore data changes
\begin{itemize}
\item userspace ABI changes
\end{itemize}
\end{itemize}
\end{frame}

\subsection{}

\begin{frame}[containsverbatim]
\frametitle{Questions / Comments}
Thank you for your attention!
\vskip30pt
\begin{Verbatim}[commandchars=\\\{\}]


RCPT TO:<john.ogness@linutronix.de>
\end{Verbatim}
\end{frame}

\end{document}