svn commit: r256957 - user/glebius/course/05.memory
Gleb Smirnoff
glebius at FreeBSD.org
Wed Oct 23 10:09:21 UTC 2013
Author: glebius
Date: Wed Oct 23 10:09:21 2013
New Revision: 256957
URL: http://svnweb.freebsd.org/changeset/base/256957
Log:
Couple more bits on uma.
Modified:
user/glebius/course/05.memory/lection.tex
Modified: user/glebius/course/05.memory/lection.tex
==============================================================================
--- user/glebius/course/05.memory/lection.tex Wed Oct 23 09:54:58 2013 (r256956)
+++ user/glebius/course/05.memory/lection.tex Wed Oct 23 10:09:21 2013 (r256957)
@@ -781,28 +781,70 @@ ITEM & SIZE & LIMIT & USED & FR
\begin{column}{.03\paperwidth}
\end{column}
\begin{column}{.97\paperwidth}
-m = uma\_zalloc(zone, \ldots);
-\begin{tikzpicture}[node distance=5mm]
- \node [name=zone, struct, rectangle split parts=4] {
+\begin{tikzpicture}[node distance=5mm, font=\scriptsize]
+ \node [name=keg, struct, rectangle split parts=4] {
+ \textbf{struct uma\_keg}
+ \nodepart{two} LIST\_HEAD(,uma\_slab) uk\_part\_slab
+ \nodepart{three} LIST\_HEAD(,uma\_slab) uk\_free\_slab
+ \nodepart{four} LIST\_HEAD(,uma\_slab) uk\_full\_slab
+ };
+
+\tikzset {
+ slab/.style = {draw, thick, rounded corners,
+ rectangle split, rectangle split draw splits=false,
+ rectangle split horizontal,
+ minimum width=10ex, minimum height=3ex},
+ fslab/.style = {slab,
+ rectangle split part fill={struct!50, struct!50, struct!50,
+ struct!50}},
+ pslab1/.style = {slab,
+ rectangle split part fill={struct!50, struct!50, white!50,
+ white!50}},
+ pslab2/.style = {slab,
+ rectangle split part fill={struct!50, white!50, white!50,
+ white!50}},
+ eslab/.style = {slab,
+ rectangle split part fill={white!50, white!50, white!50,
+ white!50}},
+}
+
+ \node [name=fslab1, fslab,
+ below=10mm of keg.south west, anchor=north west, xshift=-8mm] {};
+ \node [name=fslab2, fslab, node distance=1mm, below=of fslab1] {};
+ \node [name=fslab3, fslab, node distance=1mm, below=of fslab2] {};
+ \node [name=fslab4, fslab, node distance=1mm, below=of fslab3] {};
+ \node [name=pslab1, pslab1, right=of fslab1] {};
+ \node [name=pslab2, pslab2, node distance=1mm, below=of pslab1] {};
+ \node [name=eslab, eslab, right=of pslab1] {};
+
+ \draw [pointer] (keg.four east) -- ++(1mm,0) -- +(0,-5mm) -| (fslab1.north);
+ \draw [pointer] (keg.three east) -- ++(2mm,0) -- +(0,-14mm) -| (pslab1.north);
+ \draw [pointer] (keg.two east) -- ++(3mm,0) -- +(0,-22mm) -| (eslab.north);
+
+\onslide<2-> {
+ \node [name=zone, left=of keg, struct, rectangle split parts=4] {
\textbf{struct uma\_zone}
\nodepart{two} struct uma\_cache uz\_cpu\lbrack$ncpus$\rbrack
\nodepart{three} LIST\_HEAD(,uma\_bucket) uz\_buckets
\nodepart{four} struct uma\_keg *uz\_keg
};
- \node [name=cache, below left=5mm and 0mm of zone,
+ \node [name=cache, below=of zone.south west, anchor=north west,
struct, rectangle split parts=3] {
\textbf{struct uma\_cache}
\nodepart{two} uma\_bucket\_t uc\_freebucket
\nodepart{three} uma\_bucket\_t uc\_allocbucket
};
- \node [name=bucket, below=of zone, struct, rectangle split parts=4] {
+ \node [name=bucket, below=of cache.south west, anchor=north west,
+ struct, rectangle split parts=4] {
\textbf{struct uma\_bucket}
\nodepart{two} int16\_t ub\_cnt
\nodepart{three} int16\_t ub\_entries
\nodepart{four} void *ub\_bucket\lbrack\rbrack
};
- \draw [pointer] (zone.two west) -| (cache.north);
- \draw [pointer] (cache.two east) to [out=0, in=180] (bucket.one west);
+ \draw [pointer] (zone.two west) -- +(-3mm,0) |- (cache.one west);
+ \draw [pointer] (cache.two west) -- +(-3mm,0) |- (bucket.one west);
+ \draw [pointer] (zone.four east) to [out=0, in=180] (keg.one west);
+}
\end{tikzpicture}
\end{column}
\end{columns}
More information about the svn-src-user
mailing list