15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

that we refer to as aggressive prefetching.<br />

In each I/O, the next block required from each disk is fetched<br />

provided there is enough free buffer space; if not then only the block demanded immediately by the<br />

computation is read. Such an aggressive prefetching scheme, while intuitively attractive, can be shown<br />

to have poor worst-case as well as average-case performance. There exist worst-case reference strings for<br />

which aggressive prefetching can perform Θ(<br />

D)<br />

times as many I/Os as the optimal scheduling strategy [11].<br />

In the average case, when the accesses are assumed to be randomly distributed across the disks with<br />

independent uniform probability, it has been shown that reading a reference string of length N requires<br />

2<br />

Θ(<br />

N/<br />

D)<br />

I/Os using a buffer of size Ω(<br />

D ) blocks [48].<br />

The problem with aggressive prefetching is that it prefetches too deep on some disks, holding up buffer<br />

space that could better be used in fetching more immediately required blocks. A simple heuristic to<br />

correct for this is to place a bound on the depth of prefetching. One such attractive policy is to always<br />

give priority to a block that is required earlier in the reference string over one that is accessed later,<br />

whenever there is insufficient buffer space to hold both blocks. Intuitively this scheme tries to keep all<br />

disks busy by fetching greedily, but prevents blocks that are prefetched very much earlier than their time<br />

of usage from holding up buffer space that can be used by other more urgently needed blocks. This<br />

greedy algorithm is referred to as earliest required first (ERF) prefetching.<br />

Consider the following example of an I/O system with three disks and an I/O buffer of capacity 6. Let<br />

the blocks labeled a<br />

i<br />

© 2002 by CRC Press LLC<br />

(respectively b<br />

i<br />

a<br />

1<br />

a<br />

2<br />

a<br />

3<br />

a<br />

4<br />

, c ) be placed on disk A (respectively B, C), and the reference string be<br />

i<br />

b<br />

1<br />

c<br />

1<br />

a5<br />

b2<br />

c<br />

2<br />

Figure 33.1(a) shows the I/O schedule constructed by the ERF algorithm described above. In the first<br />

step blocks a1,<br />

b1,<br />

and c1<br />

are fetched concurrently in one I/O. When block a2<br />

is requested, blocks a2,<br />

b2,<br />

and c2<br />

are fetched in parallel in step 2. Subsequently the buffer contains five blocks: a2,<br />

b1,<br />

b2,<br />

c1,<br />

and c2.<br />

Next when a3<br />

is requested, an I/O needs to be done to fetch it; however, there is buffer space for only one<br />

additional block besides a3,<br />

and the choice is between fetching b3,<br />

c3,<br />

or neither. Fetching greedily in the<br />

order of the reference string means that we fetch b3.<br />

Continuing in this manner we obtain a schedule of<br />

length 9. Figure 33.1(b) presents an alternative schedule for the same reference string. The first two steps<br />

in the schedule are identical to the previous case. In step 3, c3<br />

that occurs after b3<br />

is prefetched; and in<br />

step 4, c4<br />

is fetched by evicting b2<br />

even though c4<br />

is referenced only after b4;<br />

however, by doing so the<br />

overall length of the schedule is reduced to 7, better than the previous schedule.<br />

FIGURE 33.1<br />

Disk A a<br />

1<br />

Disk B b<br />

1<br />

Disk C c<br />

1<br />

Disk A a<br />

1<br />

Disk B b<br />

1<br />

Disk C c<br />

1<br />

a<br />

2<br />

b<br />

2<br />

c<br />

2<br />

a<br />

2<br />

a<br />

3<br />

b<br />

3<br />

b 2<br />

c<br />

2<br />

a<br />

4<br />

(a)<br />

a<br />

3<br />

c<br />

3<br />

(b)<br />

a<br />

6<br />

(a) Greedy ERF schedule. (b) Optimal schedule.<br />

b<br />

3<br />

a<br />

5<br />

b<br />

4<br />

c<br />

3<br />

a<br />

4<br />

c<br />

4<br />

c<br />

3<br />

a<br />

7<br />

a<br />

6<br />

c<br />

4<br />

b<br />

4<br />

a<br />

5<br />

b<br />

2<br />

c<br />

5<br />

a<br />

7<br />

c<br />

5<br />

c<br />

4<br />

c<br />

5<br />

a<br />

6<br />

b<br />

3<br />

c<br />

6<br />

c<br />

6<br />

c6<br />

c7<br />

c<br />

7<br />

a<br />

7<br />

b<br />

4<br />

c<br />

7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!