CORROBORACIÓN DE LA TEORÍA ECONÓMICA
FIN DE LAS CORROBORACIONES Entonces he corroborado mis teorías:
Si nce the t,. ,. port ion of a transfer usua l ly exceeds the other time coniponents by a considerable amou n t . t h e HSC design conta ins two a lgorithms that m i n i m i ze the time spent mO\' i ng the d isk heads. The a lgori th ms reorder the input request strea m i n to a seq uence that redu ces the d istance the heads must travel over t he disk su rface 13ecause more than one req u est must be omstanding (from one or more hosts ) for t h is reorde ring to occur, the i nternal l ist of deferred req uests is used to deter m i ne which one to service next .
As each ORAl' is constructed a nd sent to the K .sdi for process i ng, t he P io w i l l u pdate a n i ntern a l vari able assoc iated w i t h each d i sk that i nd icates the current head pos i t ion . (This variab le shows t he head pos ition u pon completion of the last D RAT. wh ich docs not necessarily correspond to t he cur· rent head pos i t ion . ) When new host requests arrive and deferral is necessary . these requ ests are placed
in the interna l holding list, which is mai nta ined in ascend ing cyl inder sequence .
When a DRAT completes, the first algorithm in the P.io will search the internal holding list for t he request with the next higher cylinder number t han that indicated by the current head-position variable . That search causes t he disk head ro move from low to high cyli nder numbers . If the deferred l ist has no requests with h igher nu mbers, t he direction w i l l be set ro scan downwards and the next lower cyl inder number w i l l be used . Once the l ist has been exhausted in the downwards direction , the direc tion will be set ro up and the process repeated .
This algorithm sequence is analogous ro an eleva tOr moving from the lowest floor where a button has been pushed tO the highest tloor where a button has been pushed, then back to the lowest floor, stOp ping at each floor where a button has been pushed . Each disk cyl inder is guaranteed to be serviced by proceeding i n this fashion . Moreover, requests con t i nually arriving for a specific cylinder will not lock out other, more distant cylinders, since t he scan immediately moves on to t he next cylinder once one has been serviced.
As the nu mber of outstanding requests mounts, this algorithm may add latency tO some requests. Return i ng to t he elevator analogy, consider a request for service made on the second floor of a ten-srory building when the elevator is at the fifth tl oor and rising. I t is reasonable to expect the eleva cor to stop at t he sixth through tenth floors on the way up. If it also stops for requests on the ninth through third floors on the way down, however, the second-floor request will wa it an extremely long time. Translating this elevator analogy to the actual disk case, the latency of an i ndividual request (sec ond floor) has been sacrificed to ensure a high request rate (ninth through third floors) . Although clearly a goal of any high-performance controller, an increased request rate is of questionable value if latency is traded off to attain it.
For this reason , the HSC design invokes a second algorithm when t he nu mber of outstanding requests exceeds seven. In that case, the upward scan pro ceeds as before but w i l l go directly to the lowest cylinder when there are no more h igher cyli nders. Using our ana logy, the elevator wou ld proceed directly to t he lowest floor once the h ighest floor had been reached. Although this a lgorithm reduces the overal l request rate somewhat, it reduces the maximum latency figu res even more . Thus a reason able balance is achieved berween request rate and latency.
More specifically, a request arriving while the first a lgorithm is in effect may have to wai t for 2c cylinders of t i me , i n which c is the total nu mber of
Digital Tecbnicaljournal No. 8 February 1989
c
Figure 4 Seek Reordering Algorithms cylinders. With the second algorithm in effect, how ever, the maximum wai ting t i me decreases to c, a potential reduction of 50 percent in individual request latency. This second algorithm is known as the scan algorithm because it effectively scans the disk su rface from l ow to h igh cyl i nders, then drops back to low again and repeats the scan .
These two algorithms are i l lustrated i n Figure 4 . The el«;:varo� a lgorithm smoothly transitions from low ro high cyl inder nu mbers, then smoothly transi tions from h igh back to low . The scan algorithm, on the other hand, smoothly transitions from low 10 h igh , t he n abruptly moves tO the lowest cyl inder and begins i ts upwards scan again .
The increases in the throughput rate for requests are depicted in Figure 5. This curve was generated by a host program that made single-block requests d istributed randomly over the entire disk surface. The venical axis represents the number of requests per second being processed, which is l i m ited by the mechanical time to physically move the disk heads. The horizontal axis represents the number of requests that t he host has outstandi ng at any one t i me .
As shown , an i ncrease i n request rate occurs when the number of requests outstanding from the host increases from one to two. This i mprovement is due ro the fact that the MSCP server will place the second request on the K .sdi work queue, allow i ng the K.sdi to begin work immediately on the second request after the first request comp letes. No i mprovement is seen for three requests, but one is seen when fou r requests are outstanding. When three requests are outstand ing, one request (the first D RAT) is being serviced by the K.sd i , one (the second D RAT) is wait
i ng for service , and only one is maintai ned in the internal holding list. When a founh request arrives, it is placed in the internal holding area with the third request, and the P.io may choose which of t hese rwo internally held requests ·to issue next , al lowing optimization to occur .
The request rate drops slightly when between nine and ten requests are outstanding. At nine, one request is being serviced by t he K.sd i , one is in t he
35
Storage Technology 60 Cl 50 z 0 � 40 (f) a: � 30 (f) f- ill 20 ::J a � 1 0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 20 2 1 2 2 2 3 2 4 25 N U M B E R OF OUTSTA N D I N G REQUESTS
Figure 5 Effect of Seek Reordering on Request Rate K.sdi work queue, and seven remain i n the internal
holding list. When ten requests are outstanding, t he number of requests i n the internal holding list exceeds seven. In that case, the MSCP server will switch from the first algorithm to the second (from the elevator algorithm to the scan algori thm) . As
shown, a slight drop in the overall request rate occurs and the remainder of the curve shows a slower rise since request latency is now given pref erence over request throughput.