summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-09-17 14:38:50 +0200
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-09-17 14:38:50 +0200
commit56c7e9b328ac4e5e0bf00609039e04a049c9f807 (patch)
treec8d78e6ce2d4f3792babc47fa731ad4ac5201b66
parentc56f4ed77d4d4093f7aac091fa16da2a7fe5b2c1 (diff)
add slide about api rules
-rw-r--r--optimus.pdfbin194987 -> 223403 bytes
-rw-r--r--optimus.tex32
2 files changed, 26 insertions, 6 deletions
diff --git a/optimus.pdf b/optimus.pdf
index 5e874e5..18eeff5 100644
--- a/optimus.pdf
+++ b/optimus.pdf
Binary files differ
diff --git a/optimus.tex b/optimus.tex
index 5f861eb..11a8758 100644
--- a/optimus.tex
+++ b/optimus.tex
@@ -30,7 +30,6 @@ language=C++,
columns=fullflexible,
keepspaces=true,
breaklines=true,
-tabsize=4,
showstringspaces=false,
extendedchars=true}
@@ -163,8 +162,15 @@ extendedchars=true}
\begin{frame}[fragile]
\begin{block}{Reservation single object reservation usage (WIP!)}
- \begin{lstlisting}[tabsize=8,basicstyle=\ttfamily\tiny]
- ret = object_reserve(obj, interruptible, wait_unreserved, NULL);
+ \begin{lstlisting}[basicstyle=\ttfamily\tiny]
+ struct reservation_object *obj;
+
+ // Returns: 0 on success
+ // -EBUSY if no_wait_unreserved = true and object was already reserved
+ // -ERESTARTSYS if interruptible = true and a signal was queued.
+ // -EAGAIN if ticket != NULL and we have to restart reservation.
+ // -EDEADLK if you try to reserve the object with the same ticket twice
+ ret = object_reserve(obj, interruptible, no_wait_unreserved, ticket := NULL);
if (!ret) {
ret = party_with_object(obj);
object_unreserve(obj, NULL);
@@ -174,14 +180,15 @@ extendedchars=true}
\end{block}
\begin{block}{WARNING!!}
\begin{itemize}
- \item Will deadlock if you try holding multiple reservations like this, lockdep will warn about that case.
+ \item You will deadlock if you already hold a reservation\textunderscore object and try to call object\textunderscore reserve with no\textunderscore wait\textunderscore unreserved=false.
+ Lockdep will catch this situation.
\end{itemize}
\end{block}
\end{frame}
\begin{frame}[fragile]
\begin{block}{Reservation multi object reservation usage (WIP!)}
- \begin{lstlisting}[tabsize=8,basicstyle=\ttfamily\tiny]
+ \begin{lstlisting}[basicstyle=\ttfamily\tiny]
retry:
reservation_ticket_init(&t);
for (...; obj; ...) {
@@ -201,9 +208,22 @@ retry:
object_unreserve(obj, &t);
reservation_ticket_fini(&t);
return ret;
- \end{lstlisting}
+ \end{lstlisting}
\end{block}
\end{frame}
+ \begin{frame}
+ \begin{block}{Fence api rules}
+ \begin{itemize}
+ \item When holding a reservation on a obj, the fence members can be read and written.
+ \item Any fence calls must be made after reserving and before unreserving.
+ \item Only one new fence needs to be allocated for all reservation buffers held.
+ \item BUF\textunderscore MAX\textunderscore SHARED\textunderscore FENCE shared slots, 1 exclusive slot.
+ \item For a new shared fence, wait on the last exclusive fence before starting.
+ \item If you request exclusive access access, you should wait on all previous shared fences before starting
+ or if there are none, wait on the last exclusive fence.
+ \end{itemize}
+ \end{block}
+ \end{frame}
\end{document}