Academia.eduAcademia.edu

Cold-start vs. warm-start miss ratios

1978, Communications of the ACM

In a two-level computer storage hierarchy, miss ratio measurements are often made from a "cold start", that is, made with the first-level store initially empty. For large capacities the effect on the measured miss ratio of the misses incurred while filling the first-level store can be significant, even for long reference strings. Use of "warm-start" rather than "cold-start" miss ratios cast doubt on the widespread belief that the observed "S-shape" of lifetime (reciprocal of miss ratio) versus capacity curve indicates a property of behavior of programs that maintain a constant number of pages in main storage. On the other hand, if cold-start miss ratios are measured as a function of capacity and measurement length, then they are useful in studying systems in which operation of a program is periodically interrupted by task switches. It is shown how to obtain, under simple assumptions, the cache miss ratio for multiprogramming from cold-start miss ratio values and how to obtain approximate cold-start miss ratios from warm-start miss ratios.

I. Introduction Operating Systems R.S. Gaines Editor Cold-Start vs. W a r m Start Miss Ratios Malcolm C. Easton IBM Thomas J. Watson Research Center Ronald Fagin IBM San Jose Research Laboratory In a two-level computer storage hierarchy, miss ratio measurements are often made from a "cold start", that is, made with the first-level store initially empty. For large capacities the effect on the measured miss ratio of the misses incurred while filling the first-level store can be significant, even for long reference strings. Use of "warm-start" rather than "cold-start" miss ratios cast doubt on the widespread belief that the observed "S-shape" of lifetime (reciprocal of miss ratio) versus capacity curve indicates a property of behavior of programs that maintain a constant number of pages in main storage. On the other hand, if cold-start miss ratios are measured as a function of capacity and measurement length, then they are useful in studying systems in which operation of a program is periodically interrupted by task switches. It is shown how to obtain, under simple assumptions, the cache miss ratio for multiprogramming from cold-start miss ratio values and how to obtain approximate cold-start miss ratios from warm-start miss ratios. Key Words and Phrases: miss ratio, cold start, warm start, storage hierarchy, lifetime function, muitiprogramming, S-shape CR Categories: 3.70, 4.32, 9.35 Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title o f the publication and its date appear, and notice is given that copying is by permission o f the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission. Author's present addresses: M.C. Easton, IBM Thomas J. Watson Research Center, Yorktown Heights NY 10598; R. Fagin, IBM Research Laboratory, 5600 Cottle Rd, San Jose CA 95193. The second author carried out most of this research while at the IBM Thomas J. Watson Research Center. © 1978 ACM 0001-0782/78/1000-0866 $00.75 866 In evaluation of performance of a paged, two-level storage hierarchy, the fraction of references which are to pages not in first-level storage is a basic statistic. Such references are called misses or page faults and the fraction of references that are misses is called the miss ratio. In practice, values of the miss ratio are obtained by simulation of operation of the storage hierarchy in response to a particular reference string (typically the sequence of page addresses referenced by a selected program). The values obtained depend on the storage management policy, the choice of the reference string, the capacity (in pages) of the first level of storage, the contents of the first level at the start of the simulation, and the length of the reference string. For simplicity, we will only consider the storage management policy that brings a page into the first level when it is requested (not before) and replaces the least recently referenced page (this is also called LRU or "least recently used" replacement). Rather than choose one reference string, the common practice is to analyze a number of strings obtained from various "typical" programs. This is done for each of a number of capacities. The dependence of miss ratio on storage management policy, reference string, and capacity is obvious. On the other hand, the dependence on initial conditions and on the length of the reference string is frequently ignored in the literature. The usual procedure is to start with first level storage initially empty and to process either the entire reference string of a program's execution or a "long" section of such a string. There is an initial period during which the first level fills. The number of references required to fill the first level increases rapidly as its capacity increases. Nevertheless, even for large capacities, it is often assumed that miss ratio measurements over "long" reference strings with an initially empty first-level store are representative of miss ratios for operation when the program maintains a constant number of pages in the first level. We will show that incorrect application of this assumption can lead to incorrect interpretations of data and thus to errors in modeling of computer system performance. For example, the widely publicized "S-shape" [1, 3, 12] of plots of the reciprocal of miss ratio versus capacity can be explained by the fact that for large capacities, most of the page faults are incurred while filling the first level. For similar reasons, an understanding of the effect of page size on miss ratio is obscured by failure to consider the importance of initial conditions. In order to clarify the situation, we introduce terminology and notation that explicitly give information on initial conditions and on the length of the reference string used in the measurement. The cold-start miss ratio (to the first-level store) with capacity CAP measured for a string of length T, denoted COLD(CAP, T), is the L R U miss ratio starting with an initially empty first-level store. (If the measurement starts at time t with an initially Communications of the ACM October 1978 Volume 21 Number 10 empty first-level store, then we say that the miss ratio is measured from a coM start at time t.) The warm-start miss ratio (to the first-level store) with capacity CAP measured over T references, denoted WARM(CAP, T), is the LRU miss ratio starting with a filled first-level store. The initial contents of the first level and L R U stack positions of the stored pages are obtained from the portion of the reference string prior to the start of measurement. An important difference between these miss ratios is that while WARM(CAP, T) can be zero, COLD(CAP, T) includes the effect of initial misses and so is positive for all finite T. For many values of (CAP, T), these miss ratios are nearly equal. In particular, it is easy to see that they differ by no more than CAP/T if both measurements start from the same point o f the string. However, if CAP/T is of the same order of magnitude as the miss ratio, then the distinction between the two becomes important. In the following sections we argue that warm-start miss ratios should be measured if behavior of a program running uninterrupted for indefinitely long periods of time is being studied. On the other hand, under some reasonable assumptions, cold-start miss ratios of a program obtained for moderate values of T (e.g. 102-105) can be used to compute that program's miss ratio under multiprogramming (when the effect of task-switching must be considered). Thus cold-start miss ratios are useful in studying certain aspects of multiprogramming performance. If a long reference string is available, then a reasonable procedure for obtaining cold-start miss ratio values is to determine for each pair (CAP, T) an average value of COLD(CAP, T). To obtain this value we compute the number of misses to an initially empty first-level store of size CAP, for each substring of length T, and then we average the results. A practical procedure for carrying out this computation is described in [8]. If CAP is greater than the number of distinct pages in every substring of length T, then this procedure is equivalent to finding average working-set size (i.e. the average number of distinct references in a substring of T references). Figure 1 shows average values of COLD(CAP, T) measured for two values of CAP and several values of T. The measurement was carried out on a string of references to 32byte pages (a typical page size for a cache) generated by an astronomical orbit calculation program. If a reference string is available, then one can obtain estimates of COLD( CA P, T) for specific ( CA P, T ) values by direct measurement. However, there is a considerable body of existing miss ratio data for various values of CAP obtained using a single "large" value o f T. We will give a method for obtaining approximate values of COLD( CA P, T) for various values of T from such data. 2. Shape of the Lifetime Function In modeling of computer system behavior, the usual assumption is that the reference string is a realization of 867 Fig. I. 10°~ ..... - , ,.,,.' , ,,.,,, , ,I,,,,, , ~,,,,,, + ,,,,,, ® × CAP:I28 o CAP:I024 8® ® ® ® gx IO-I o c oo o o 10-2 i i I0° Hiit][ i i iiiiii I0 z i tllDII 10 3 I0 4 IO 5 IO 6 T a stationary stochastic process (we will formally define stationarity in Section 4). More specifically, there is a set of integers called the set of page names and a sequence of random variables ...R-2, R_,, Ro, R,, R2... whose values are page names (intuitively, the value of R, is the name of the page referenced at time t). Therefore for a particular value of CAP, under L R U management, there is a random variable W~.t(CAP) whose value is the number of (warm-start) page faults generated by (R,,, R,,+,. . . . . R,,+t-,), where Ri generates a (warm-start) page fault (a _< i _< a + t - 1) iff the value of Ri is not contained among the previous CAP distinct values of ( .... Ri-2, Ri-1 ). For a stationary sequence we define the (limiting) miss ratio to be M( CA P) = lim W,,.t(CA P) t~ (2. l) t The strong law of large numbers [5] implies existence of M(CAP) with probability one. A little thought shows that this limit does not depend on cc For a stationary sequence, we define the (limiting) lifetime to be L(CAP) = lim t , 4 . W,,,,(CAP) . (2.2) By existence of M(CAP) with probability one and by (2.1), with probability one L(CAP) exists and L(CAP) = I/M(CAP). The lifetime can be thought o f as the average time between page faults. A reasonable method for estimating the value of L(CAP) is by measuring t/(W,,.t(CAP)) for finite t. Note that this estimate is the reciprocal of a warm-start miss ratio. If the first reference recorded is the value of R1, then the value of CAP must be such that the set of values taken by {R1, R2..... R,-,} contains at least CAP distinct values. It is not possible to obtain the value of W,.t(CAP) otherwise, since then it depends o n Ri for i < 1 and this information is not available. If the first a - 1 references Communications of the ACM October 1978 Volume 21 Number 10 of the recorded string contain fl distinct references then, using the ath reference as a starting point, we can compute warm-start miss ratios over the remainder of the string for CAP = l, 2 . . . . . fl and thus estimate L(CAP) for these values, by finding the reciprocal of the warm-start miss ratio. However, a number of measurements of lifetime functions have been obtained by measuring I/COLD(CAP, K) where K is the length of the available reference string. Using this method, Belady and Kuehner [l] observed that plots of the lifetime as a function of capacity for several programs have approximately an Sshape, that is, a convex ("up") portion followed by a concave ("down") portion. They comment that the flattening out of the lifetime function curve for large capacities might be due to two factors: (I) The effect of initial loading misses, so that the lifetime function for large capacities is bounded by the length of the recorded string divided by the number of initial loading misses (misses caused by the first reference to each page). (2) The effect of diminishing returns due to program locality. Possible factor number (2) is repeated frequently in the literature [3, 6]. Under the scenario of factor (2), the program has already accumulated its "working set" somewhere near the point of inflection [7]. Indeed, the lifetime function is modeled in [3] by a curve with this assumption built in, and values of this function are used as parameters of a stationary page fault process. In order to examine the plausibility of the two explanations suggested above, we examined several program traces of length 1.5 X 106 references, with measurements beginning after 5 x 10'~ references. The page size was 2048 bytes. We found that the lifetime function measured by the warm-start method did not usually flatten out for large capacities. Figures 2-4 show the startling difference Fig. 3. IO000 LA&&&A• A 8000 ~ ~m to to • x 6000 4000 t O ,~ ~o 2000 | ~o. i 0 0 oee.o! o, @*~8~ o COLD-START P 50 IOO 150 tO000 300 a •&& 8000 ••••&' _o 6 0 0 0 - - a: to to ~ 4000 -- 00oo0 ,ooooo •O • WARM-START i 1.... 4 o COLD-START 6~ I O'-- 8000 0 &• 25 50 75 IO0 ! 1 125 150 175 CAPACITY .&& 6ooo to A•&l&&&8&-~&a• 4000 • &A I °° &•• ~°°°°°°°~ &coo _ O000C ooOOOtX) O000C j • WARM-START 2000 o COLD--START ! l 0 ,50 IO(3 150 CAPACITY 868 250 Fig. 4. 10000 0 200 CAPACITY 2000 Fig. 2. i r • WARM-START 200 250 between lifetime functions obtained by cold-start and warm-start method for three different program address traces. (Because of statistical uncertainties, the graphs were plotted only at capacities such that at least one hundred warm-start misses were observed.) In each case, the cold-start and warm-start measurements were carried out over identical portions of a\ reference string. The cold-start lifetime in each case levels off at a value equal to the number of references (106) divided by the number of distinct references in the measured portion of the string. The results indicate that for large capacities, far more page faults occur in filling the initially empty firstlevel store than in the remainder of the string. Thus, the Communications of the A C M October 1978 Volume 21 N u m b e r 10 cold-start miss ratios do not represent behavior of a filled first-level store for large capacities and factor (1) seems to explain the flattening. We suggest use o f warm-start miss ratios as estimates for the limiting lifetime function. Furthermore we suggest that in analyses of systems in which a program maintains a constant number of pages in main storage, the lifetime for the program should not be assumed to be S-shaped. 3. Effect of Page Size on Miss Ratio In this section we note another difference between cold-start and warm-start miss ratios. In [10] and [11] it is shown that in certain simple models of page reference strings, the expected miss ratio is nearly independent of page size, if the size of first-level storage (in bytes) is held fixed. (In these models the expected miss ratio is equal to the limiting miss ratio M ( C A P ) defined in the previous section, with probability one.) This steady-state analysis corresponds to using warm-start miss ratios; indeed, when simulations are carried out using these models, observed warm-start miss ratios are approximately independent of page size, as predicted. On the other hand, if cold-start miss ratios are measured for a very large capacity, then doubling the page size causes the coldstart miss ratio to be approximately halved (this effect appears dramatically in the miss ratio curves of Chu and Opderbeck [4]). The reason is simple: if first-level storage is large enough to hold the entire program, then all coldstart page faults occur while filling the initially empty first-level store. If the first level can hold the entire program, then there are approximately half as many of these initial loading misses when the page size is twice as large. Thus in order to understand the effect of page size on miss ratio, the effect of page size on the number of initial loading misses should be separated from the effect of page size on the limiting miss ratio. The relative importance of the two factors depends on the length of time the program runs. 4. Effect of Task Interruptions on Miss Ratio We now discuss cases in which initial loading misses play a major role in determining miss ratio. Miss ratios are usually obtained from reference strings generated by a single program. In such an analysis, it is assumed that once CA P distinct pages have been referenced, from then on first-level storage always contains the C A P pages that have been referenced most recently. In multiprogramming systems, however, task switches often interrupt the execution of a particular program. Before execution of the program resumes, some or all of its pages in firstlevel storage may be replaced by pages of other tasks. One specific case in which this occurs is in storage hierarchies .using a cache (high-speed first-level store). 869 (For a description and bibliography see [16].) The unit of transfer between cache and main storage is called a line. During execution, the lines referenced by a program enter the cache, pushing out lines of other tasks. When one of these other tasks resumes execution, some or all of its lines have been displaced, so its miss ratio is generally higher than when running uninterrupted. (Compare columns 5 and 6 of Table I, which contain some empirical results. These results were obtained from the string of references generated by an astronomical calculation program, ORBIT, and from a P L / I compiler, PLCOMP. In both cases the reference string consisted of 5 × 10'~ references to 32-byte lines.) A similar phenomenon can occur under certain management policies for main storage. If a task is considered to be currently inactive (e.g. no human response to an interactive program has occurred for a period of time), then the pages associated with the task are replaced by pages requested by other tasks. Later, when the task becomes active again, its pages are brought into main storage on demand. As in the cache case, the loss of pages during an inactivity period causes the miss ratio to increase over the value when run without interruption. We will discuss the cache case in some detail. We will assume throughout that all cache lines belonging to a program are pushed out of the cache between that program's execution intervals. In many systems this is nearly always true. Otherwise, this can be considered a "worst case" assumption. We will describe a rather general stochastic model for the reference sequence and task switch process. In this context, we consider the cold-start miss ratio to be a random variable. We show that the long-run cache miss ratio for a program under task switching can be expressed as a weighted average of expected cold-start miss ratios for that program's uninterrupted reference string. The weights are determined by the probability distribution of lengths of execution intervals. When the latter distribution is not known, we show that the assumption that all execution intervals are o f equal length yields the maximum cache miss ratio for a given task switch rate. We begin by defining precisely our notion of stationarity. A sequence of random variables ...H-2, H-l, H0, H~, //2 each having as range the set G = {gj, g2.... } is said to be stationary if for every two sets of a integers {il,/2 . . . . . i,} and {fi,j2 . . . . . j,,) and for every integer fl: Pr (Hi, = gi, . . . . . Hi,, = g~o} = Pr (Hi,+B = g j . . . . . . Hi,,+B = gi,,}. Taking a = 1, for example, we see that E[HI] is the same for all 1. We assume that the reference string is a realization of (Ri), a stationary sequence. Let C A P be the number of cache lines available to the task. In this section, we will use C O L D ( CA P , T ) to denote the expected cold-start miss ratio, i.e., the expected value of the random variable equal to I / T times the number of misses generated by Rt . . . . . R t + T - ] with a cold start at time t. Let ~'i, i = 1, 2, Communications of the ACM October 1978 Volume 2i Number 10 Table 1. Execution Interval Determined by Main Storage Page Faults; Cache Line Size = 32 Bytes. Col Program I 2 3 Mean length of execution interval ~r Cache capacity (lines) CAP Average value of ORBIT 2910 PLCOMP 5510 256 512 1024 256 512 1024 4 Cache miss ratio from application of (4.3) or COLD(CAP,?') equivalently, of (4.4) 0.10 0.10 0.10 0.050 0.050 0.050 0.089 0.082 0.057 0.042 0.040 0.037 ... be a random variable giving the length of the ith execution interval. Thus if ~'1 -- j then the first execution interval contains R1. . . . . Rj. The second interval begins with Rj÷~, etc. Let ~Ii(CAP), i = l, 2 .... be a random variable giving the number of misses to a cache of size CAP in the ith execution interval, under the assumption that the cache contains no lines of the task at the start of the interval. We assume that random variables {'ri} and {~li(CAP)} have finite expected values and variances and that ( ' r i ) and (Tli(CAP)) are stationary sequences. We also assume that each has autocorrelation asymptotically zero (that is, the correlation between ~'i and "ri+xgoes to 0 as x --~ 0% similarly for O/i).) We define the long-run cache miss ratio to be the limit (as k --* oo) of k k Z hi( CA P ) / Z vi i=l (4.1) i~l The assumptions imply that ('ri) and Oli(CAP)) satisfy the weak law of large numbers, from which it follows that (4. l) converges in probability to" E[rli( CA P)])/E['r~] (4.2) Letting PT denote Pr[1-i -- T], and ~r = ~ . ~ T.Pr, the expected interval length, we can write (4.2) as: 0o Z (E[~i(CAP)I~'i = T]PT)/~ T~I Finally, we assume that T. COLD(CAP, T), the expected number of cold-start misses in T references, is equal to E[yi(CAP)[~'i = T]. This means that the expected number of cold-start misses in an arbitrarily chosen substring of length T, starting with an empty first-level store, is the same as the expected number in an execution interval of length T. This feature of the model is easily justifiable if the task switches are caused by time slicing or by interrupts associated with other tasks, since then the task switches are caused by a mechanism independent of the program in execution. However, even if task switching is primarily caused by main store page faults, then the cache fault process, taking place on a "microscopic level" relative to main store references, may not depend significantly on the 870 5 Measured cache miss ratio assuming none o f program's lines are present in cache at start of each execution interwd 0.087 0.079 0.057 0.045 0.04 1 0.037 6 Measured cache miss ratio when program is run uninterrupted 0.077 0.064 0.014 0.033 0.028 0.021 times of occurrence of the main store page faults. For example, a program transferring control from page to page occasionally has a page fault. But the code executed on pages causing faults need not have significantly different statistical properties from the code executed on other pages. Under all these assumptions, the long-run cache mass ratio is: Relation (4.3) has been tested empirically for several program traces where task switches were caused only by main store page faults and where values of PT and COLD(CA P, T) were estimated from the reference string being tested. Assuming stationarity of (Ri), it is not hard to show that the procedure of averaging the cold-start miss ratios over all substrings of length T gives an unbiased estimate for COLD(CAP, T). Values obtained from (4.3) by substituting average cold-start miss ratios for COLD(CAP, T) were compared with the observed average cache miss ratio (total misses divided by number of references) obtained assuming emptying of the cache at each task switch. The compared values for the strings tested agreed within 6 percent for values of CAP = 256, 512, and 1024 lines, with each line of size 32 bytes. Typical results appear in columns 4 and 5 o f Table I. One application of (4.3) is to yield a lower bound for long-run cache miss ratio under multiprogramming as cache capacity is increased, if we assume that the cache is nevertheless too small to retain any of the task's lines at the start of the task's next execution interval. This bound is obtained by using COLD(w,T) for COLD(CAP, T) in (4.3). This value COLD(~,T) is simply l / T t i m e s the expected number of distinct cache lines in a substring o f length T. For the remainder of this section, we will hold CAP fixed. Denote T. COLD(CAP, T), the expected number of cold-start misses after T references, by At(T). Then our formula (4.3) for the long-run cache miss ratio becomes Communications of the A C M October 1978 Volume 21 N u m b e r 10 Note that/~(T) has been defined only for integral values of T. It will be convenient to define &(T) for nonintegral values of T by linear interpolation. Suppose that the probability distribution (Pv} of execution interval lengths is unknown, but that the expected execution interval length, T, is known. Then in (4.4), the assumption that all intervals have length yields for the cache miss ratio the value of &( ~ / 7 " (that is, COLD(CAP, T), if I" is an integer). At the conclusion of this section, we will show that this value, N ( T ) / T , is an upper bound for (4.4). So for fixed 1", uniform interval lengths gives the highest cache miss ratio. If task switches are caused primarily by main storage page faults, then &( T ) / T may be considerably larger than (4.4). (In Table I, compare the estimates in column 3 for COLD(CAP, fF), which are also estimates for &( 7")/I", with the values in column 4, which are obtained from (4.3) or (4.4), and note that the values in column 3 are larger than the corresponding values in column 4.) Measurements by G h a n e m [13, 14] suggest that (PT} has approximately a hyperexponential distribution when all task switches are caused by page faults. If all task switches are caused by page faults, then use of such a distribution should give more accurate cache miss ratios than those obtained with intervals of equal length. We will now prove that under the stochastic assumptions of this section, & ( T ) / I " is greater than or equal to (4.4), that is, that the expected value of an entry in column 3 of Table I is greater than or equal to the expected value of the corresponding entry in column 4. (4.5) Since /q(T) is defined by linear interpolation for nonintegral T, it is clear from geometric considerations, and not difficult to prove, that (4.5) implies concavity of the function (in other words, if N is "concave at integer points," then it is "concave everywhere"). Let Ui.j be a random variable whose value is 1 if R~+j-1 takes a value that causes a cold-start miss with a cold start at time i. Otherwise the value of U~.i is zero. Then N( T) = E[ Ui.I + Ui,2 + ... Ui,T] = E[U;.,] + E[U;.z] + ... + E[Ui.T] a~+az+...+aT, where from each fi we define aj to be E[U,,i], the expected value of U/.y. (Stationarity of (Ri) implies that these expected values are the same for all i.) If the (i + T - l)-th reference is a miss with a cold start at 871 The previous section showed the usefulness of coldstart miss ratios in evaluating the cache miss ratio under multiprogramming. In this section we will give a simple recipe for obtaining approximations to cold-start miss ratios COLD(CAP, T) from estimates for values of M(CAP), the limiting miss ratio. Thus, assume that one has available values MISS(I), MISS(2), MISS(3) . . . . . MISS(CAP) . . . . . where MISS(CAP) is an estimate for the limiting LRU miss ratio with capacity CAP. For example, MISS(CAP) could be an observed value of COLD(CAP,7") or of WARM(CAP, Tr) for some large value of i". Using these values, we will obtain approximations to COLD(CAP, T) for certain pairs (CAP, T); other values can be obtained by interpolation. Define LIFE(CAP) to be I/MISS(CAP). If MISS(CAP) is exactly the limiting miss ratio then LIFE(CAP) is the limiting lifetime, that is, the average time between page faults, with capacity CAP (thus LIFE(CAP) is then L(CAP) as defined in (2.2)). O f course, if MISS(CAP) is an approximation to the limiting miss ratio, then LIFE(CAP) is an approximation to the limiting lifetime. For each integer k, define k--1 (5.1) i=O PROOF. It is sufficient to show that the function T -+ N ( T ) is concave (down) since then, by a fundamental property of concavity [15, p. 70], we have [q (Y~=I PTT) >--Y.~'=1PT&(T). In fact, we need only show that for each integer T_> 1, = 5. Simple Recipe for Cold-Start Miss Ratios LIFE~Ap (k)= Y. LIrE(min (i, CAP}), THEOREM 1. (/q(T))/T_> (Y.~.=j PTN(T))/T. ½ ( N ( T - 1) + N ( T + 1)) < N ( T ) . time i - l, then it is a miss with a cold start at time i. Thus Ui-1,T+~<-- Ui,T which implies aT+~ <--aT. Therefore /V(T + 1) - A/(T) = aT+~ <-- aT = IV(T) -- [ v ( r - 1), from which (4.5) follows, and the proof is complete. [] where we adopt the convention that LIFE(O) = 1. If * ( ko) = To, then the estimate given by our recipe LI F Ecap for COLD(CAP, To) is ko/To. We tested our recipe on several program address traces of length I" ~ 10" references. We used measured values of 1/ WARM( CA P, i") as values for LIFE( CA P) in (5.1) and found that our estimate was almost always within 10-15 percent of the directly observed average cold-start miss ratio. In a slightly expanded version o f this paper [9], the authors show that in a certain precise sense this recipe is good in the well-known " L R U stack model" [2, p. 275; 17]. (In this model there are fixed probabilities {ri} such that the probability that the next reference is to the page in L R U stack position i is ri, independent of past history.) It is shown in that report that if limiting lifetimes are used in the recipe and if the number of cold-start misses in T references is reasonably large, then with high probability the value of the random variable equal to the cold-start miss ratio for T references is close to the value obtained from the recipe. We will now give a rough intuitive explanation as to why our recipe is reasonable. Let To denote LIFE~Ap (ko). We will show that To is approximately the average time (number of references), starting from an initially empty first-level store, until the koth page fault. (In fact, Communications of the ACM October 1978 Volume 21 Number 10 we will show that in the L R U stack model, if we take for LIFE(CAP) the exact value o f the limiting lifetime, that is, LIFE(CAP) = 1/ • i>CAP ri, (5.2) then the value To is exactly the expected time after a cold start nntil the koth page fault.) Since the koth cold-start page fault occurs on the average at time To, a reasonable estimate for the cold-start miss ratio at time To is ko/To, which is our recipe value. We will now demonstrate our claim that in the L R U stack model, To = LIFE~ae(ko) is the expected time until the koth page fault. In the L R U stack model, it is easily verified that the time until a page is referenced which is distinct from the ! distinct pages most recently referenced has a geometric distribution with expected value LIFE(l). Thus LIFE(O) = 1 is the time till the first page fault; LIFE(I) is the expected time between the first and second page fault; LIFE(min {2, CAP}) (which is LIFE(2) if CAP _> 2, or LIFE(I) if CAP = 1) is the expected time between the second and third page fault; and so on. Hence To, which is the sum of ko such terms, is the expected time till the koth page fault. If conversely, the expected number of cold-start misses over time To (assuming To is an integer) were ko, then our recipe would exactly give the expected value COLD(CAP, To) of the cold-start miss ratio in this model. However, we remark without proof that this need not be the case, even in the L R U stack model. References I. Belady, L.A., and Kuehner, C.J. Dynamic space-sharing in computer systems. Comm. ACM 12, 5(May 1969), 282-288. 2. Coffman, E.G. Jr., and Denning, P.J. Operating Systems Theory. Prentice-Hall, Englewood Cliffs, N.J., 1973. 3. Chamberlin, D.D., Fuller, S.H., and Liu, L.Y. An analysis of page allocation strategies for multiprogramming systems with virtual memory. IBM J. Res. Develop. 17 (Sept. 1973), 404-412. 4. Chu, W.W., and Opderbeck, H. Performance of replacement algorithms with different page sizes. Computer 7, I I (Nov. 1974), 14-21. 5. Doob, J.L. Stochastic Processes. Wiley, New York, 1953. 6. Denning, P.J., and Graham, G.S. Multiprogrammed memory management. IEEE Proc. Interactive Computer Systems, 63 (June 1975), pp. 924-939. 7. Denning, P.J., and Kahn, K.C. A study of program locality and lifetime functions. Proc. Fifth Symp. on Operating Systems Principles, Austin, Texas, 1975, pp. 207-216 (available from ACM, New York). 8. Easton, M.C. Computation of cold-start miss ratios. IEEE Trans. Comptrs. C-27, 5 (May 1978), 404-408. 9. Easton, M.C., and Fagin, R. Cold-start vs. warm-start miss ratios and multiprogramming performance. IBM Res. Rep. RC 5715, IBM T.J. Watson Res. Ctr., Yorktown Heights, N.Y., Nov. 1975. 10. Fagin, R. Asymptotic miss ratios over independent references. J. Computer Syst. Sci. 14, 2 (April 1977), 222-250. ! I. Fagin, R., and Easton, M.C. The independence of miss ratio on page size. J.ACM. 23, 1 (Jan. 1976), 128-146. 12. Ghanem, M.Z. Study of memory partitioning for multiprogramming systems with virtual memory. IBM Z Res. Develop. 19, 5 (Sept. 1975), 451-457. 13. Ghanem, M.Z. Experimental study on the behavior of programs. IBM Res. Rep. RC 5460, IBM T.J. Watson Res. Ctr., Yorktown Heights, N.Y., June 1975. 14. Ghanem, M.Z. Personal communication. 15. Hardy, G.H., Littlewood, J.E., and Polya, G. Inequalities. Cambridge U. Press, London, 1964. 16. Kaplan, K.R., and Winder, R.O. Cache-based computer systems. Computer 6, 3 (March 1973), 30-36. 17. Shedler, G.S., and Tung, C. Locality in page reference strings. S l A M J. Comptng. 1, 3 (Sept. 1972), 218-241. Conclusions We have shown that knowledge of the initial conditions and the length of the reference string measured are important in properly interpreting miss ratio data. Among the errors that we believe have been committed by ignoring these factors is the assumption that an Sshaped lifetime function represents behavior of a program that maintains a constant number of pages in main storage. On the other hand, for a system in which a program's execution is periodically interrupted, we have shown the usefulness of the two-parameter "cold-start miss ratio" in analyzing miss ratio performance. Further, we have provided a simple recipe for obtaining approximate values of cold-start miss ratios from limiting miss ratios. Acknowledgments. We thank B. Ingebrand for supplying instruction trace tapes and M.Z. G h a n e m for supplying an algorithm for producing a reference string from an instruction trace. We are grateful to D. Slutz, E. McNair, and T. Moeller for allowing us to use programs they have developed, and to A.C. McKellar for reading a draft of the manuscript. Received November 1975; revised October 1976 872 Corrigendum. Scientific Applications Gabor T. Herman, Arnold Lent, and Peter H. Lutz, "Relaxation Methods for Image Reconstruction," Comm. ACM 21, 2 (February 1978), 152-158. Figure 1 was adapted from a paper by R. S. Ledley, G. DiChiro, A. J. Luessenhop, and H. L. Twigg, "Computerized Transaxial X-ray Tomography of the H u m a n Body, Science 186, 4160 (Oct. 1974), 207-212. It was incorrectly credited to Reference [l l] when it should have been credited to Reference [12], the above-mentioned paper by Ledley, DiChiro, Luessenhop, and Twigg. Communications of the ACM October 1978 Volume 21 Number 10