Next: AMP Algorithm
Up: AMP
Previous: Replacement Policy for Prefetched
Theoretical Analysis: Optimality Criteria
In this section we theoretically analyze the case when an LRU cache is
shared by prefetched data for multiple steady sequential streams.
We assume an AA algorithm operating with a cache of size
.
is
defined as the average life of a page in the cache.
Each stream has a maximum request rate,
, which is achieved
when all read requests are hits in the cache.
The aggregate throughput,
, is the sum of individual stream throughputs
(
).
Figure 2:
Starting at
ms, the average response time grows linearly with the read size.
We observed similar behavior for RAID-
implying that the
optimality criteria in this paper apply to RAID as well.
![\begin{figure}\begin{center}
{\small Average Read Response Time Vs. Read Size }
\epsfig{figure=numbers/pxt_blocksps.eps, width=3.0in}
\end{center}\end{figure}](img40.gif) |
Observation 3.1
is a monotonically non-decreasing function, where
is the
average time to prefetch
pages.
Proof.
From Figure
2 we observe that
![$ t(p)$](img42.gif)
is of the form
![$ kp + c$](img44.gif)
.
Hence,
![$ p/t(p) = \frac{p}{kp+c}$](img45.gif)
, and its slope
is positive since
![$ c$](img47.gif)
is positive.
Definition 3.1
A stream is said to be satisfied at
, if it experiences no
misses for the given
and
.
Proof.
By definition, if a stream is satisfied at
![$ (p,g)$](img48.gif)
then it experiences no
misses in the steady state. That implies that the prefetch issued at the trigger
distance
![$ g$](img3.gif)
completes before the
![$ g + 1$](img50.gif)
pages are read by the client.
Therefore,
![$ t(p) \leq (g+1)/r$](img49.gif)
, where
![$ r$](img37.gif)
is the request rate of the stream.
The reverse is also true. If the
time it takes to prefetch
![$ p$](img14.gif)
pages is not more than the time it takes the
client to read the
![$ g$](img3.gif)
pages, then there cannot be any misses in the steady state
implying that the stream is satisfied.
Observation 3.2
The throughput of a satisfied stream is equal to
, its request rate.
Proof.
By definition, a satisfied stream experiences no misses in the steady state.
No misses implies no stall time and the stream proceeds at its
desired request rate of
![$ r$](img37.gif)
.
Proof.
If
![$ g+1 > \lceil r\cdot t(p) \rceil$](img52.gif)
then
![$ g \geq r\cdot t(p)$](img53.gif)
or
![$ t(p) \leq g/r < (g+1)/r$](img54.gif)
.
By Lemma
III.1, the stream is satisfied at the chosen
![$ (p,g)$](img48.gif)
but is also satisfied for
![$ g-1$](img55.gif)
at
![$ (p,g-1)$](img56.gif)
.
By Observation
III.2, the throughput with
![$ g-1$](img55.gif)
will remain the
same as the stream will remain satisfied.
However, the cost of the case where a lower
![$ g$](img3.gif)
is used is
smaller as the average number of pages that have to be kept in the
cache is smaller. Hence, cache space is being wasted without any gain in
throughput.
Lemma 3.3
If there is no cache pollution, wastage occurs iff
.
Proof.
If there is no cache pollution,
![$ (g+1) \leq \lceil r\cdot t(p) \rceil$](img58.gif)
(Lemma
III.2).
By their definitions,
![$ p$](img14.gif)
pages are requested when
![$ g + 1$](img50.gif)
pages from the
previous prefetch are still unaccessed. The number
of these pages that are consumed in the time it takes to prefetch is
![$ r\cdot t(p)$](img59.gif)
,
which is roughly all of the unaccessed pages.
Hence, as soon as the next
![$ p$](img14.gif)
pages are prefetched, they begin to be consumed
at the request rate
![$ r$](img37.gif)
. Therefore, the time it takes for the
![$ p$](img14.gif)
pages
to be consumed after prefetch is
![$ p/r$](img60.gif)
. Now, if the
average life (
![$ L$](img36.gif)
) of pages in the cache is less than
![$ p/r$](img60.gif)
, then some of the
prefetched pages will be evicted before they are requested. Conversely, if
![$ L$](img36.gif)
is greater than
![$ p/r$](img60.gif)
then all the
![$ p$](img14.gif)
pages will be requested before
they reach the LRU end of the list and face eviction.
Lemma 3.4
If there is no cache pollution, throughput of a stream (
) =
.
Proof.
The throughput of a stream cannot exceed its request rate (
![$ r$](img37.gif)
).
Further, since we use a single outstanding prefetch for a stream at any time,
the throughput cannot exceed the amount prefetched (
![$ p$](img14.gif)
) divided by the
time it takes to prefetch that amount
![$ t(p)$](img42.gif)
. In the case where
![$ p > r\cdot L$](img63.gif)
,
wastage occurs (Lemma
III.3) and only
![$ r\cdot L$](img64.gif)
pages out of
![$ p$](img14.gif)
will be accessed before being evicted. In this case, the
throughput is limited by
![$ r\cdot L/t(p)$](img65.gif)
.
Proof.
The life of the cache (
![$ L$](img36.gif)
) is equal to the time it takes to insert
![$ C$](img35.gif)
new pages in
the top end of the cache. If there is no wastage, the rate of insertion in the
cache is equal to the aggregate read throughput of all the streams (
![$ B$](img38.gif)
).
Therefore,
![$ C/B = L$](img67.gif)
.
Lemma 3.6
For a fixed choice of
, and cache of size
, the aggregate throughput (
) is unique when there is no wastage.
Proof.
Suppose, the aggregate throughput(
![$ B$](img38.gif)
) was not unique.
Without loss of generality, we would have
![$ B' > B$](img69.gif)
, such that
Since there is no wastage, we have
for all streams.
So, the only different term in the
expression is not significant.
Thus,
, which is contrary to our assumption.
Theorem 3.1
The aggregate throughput of
streams sharing a cache of size
with average cache life
,
is maximized if
.
Proof.
Given
![$ n$](img75.gif)
streams with request rates of
![$ r_1, r_2,...r_n$](img77.gif)
and a cache of size
![$ C$](img35.gif)
, let the throughput obtained by the choice:
![$ \forall i, p^T_i = \lfloor r_i\cdot L \rfloor$](img78.gif)
be
![$ B_T$](img79.gif)
. The theorem claims that
![$ B_T$](img79.gif)
is the maximum aggregate bandwidth obtainable (
![$ B_{max}$](img80.gif)
)
through any choice of
![$ p^T_i$](img81.gif)
.
We will prove by contradiction. Let us assume that
.
Therefore, there exists some choice of
such that the
aggregate bandwidth of all streams is
.
Since wastage and cache pollution can never increase aggregate throughput,
we assume, without loss of generality, that
is free from these inefficiencies.
If the choice of
is the same as that specified by this theorem, then by
Lemma III.6,
, which is contrary
to our assumption.
![% latex2html id marker 5861
$\displaystyle \therefore \exists i: p_i \neq \lfloor r_i\cdot L \rfloor$](img85.gif) |
(1) |
By Lemma III.3, it must be the case for
that
![$\displaystyle \forall i, p_i \leq \lfloor r_i\cdot L \rfloor$](img86.gif) |
(2) |
If follows from (1) and (2), without loss of generality,
that
.
Let us define a new set:
,
where
, and
.
and
are the new cache life and aggregate throughput values.
Since
(by defn. of
),
(Lemma III.5). By Lemma III.4,
as
and
. By
Observation III.1 and Lemma III.4,
as
.
Since
![$ B^1 \leq B_{max}$](img93.gif)
, it follows that
![$ B^1 = B_{max}$](img100.gif)
.
By repeating the above procedure for every stream with
, we will arrive at a set
, where
and
.
Since, the choice of
for each stream will then be the same for
and
,
by Lemma III.6.
which contradicts our assumption that
![$ B_T < B_{max}$](img82.gif)
.
Next: AMP Algorithm
Up: AMP
Previous: Replacement Policy for Prefetched
root
2006-12-19