25.03.2013 Views

Operating Systems, CS 571, Angelos Stavrou Sample Sample ...

Operating Systems, CS 571, Angelos Stavrou Sample Sample ...

Operating Systems, CS 571, Angelos Stavrou Sample Sample ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Operating</strong> <strong>Systems</strong>, <strong>CS</strong> <strong>571</strong>, <strong>Angelos</strong> <strong>Stavrou</strong><br />

2<br />

<strong>Sample</strong><br />

In terms of the lookup algorithm, let S3 employ the serial algorithm where the lookup is<br />

first conducted in the associative registers and only after the lookup miss in the<br />

associative registers, the main-memory lookup is initiated. In contrast, let S1 and S2<br />

employ the parallel algorithm where the lookup is conducted in parallel in both the<br />

associative registers and the main-memory page table.<br />

Determine the page-lookup performance for the three schemes. In particular, compute the<br />

average time for page lookup as well as the lookup time in the case of a page hit and a<br />

page miss. Based on this computation, identify the FALSE statement among the<br />

following.<br />

Answer:<br />

In the case of S1, it takes 120ns for a page lookup hit in the associative registers and<br />

600ns if there is a page miss. Thus, the overall performance (average page-lookup time)<br />

of S1 is 0.6 * 120 + 0.4 * 600 = 312ns.<br />

In the case of S2, it takes 180ns for a page lookup hit in the associative registers and<br />

600ns if there is a page miss. Thus, the overall performance (average page-lookup time)<br />

of S2 is 0.8 * 180 + 0.2 * 600 = 264ns.<br />

In the case of S3, it takes 120ns for a page lookup hit in the associative registers and<br />

720ns if there is a page miss (because it uses a serial lookup algorithm). Thus, the overall<br />

performance (average page-lookup time) of S3 is 0.8 * 120 + 0.2 * 720 = 240ns.<br />

Therefore, S3 has the best overall performance while S1 has the worst overall<br />

performance.<br />

3. Suppose a disk has size 128GB, and blocks are of size 64KB. If all block numbers are<br />

stored as 4-byte integers, how large must a main-memory file-allocation table (FAT) be?<br />

Answer:<br />

The number of table entries is 128GB divided by 64KB, and each entry takes 4 bytes.<br />

Thus the amount of main-memory space required by the FAT is 8MB.

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

Saved successfully!

Ooh no, something went wrong!