13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Preliminaries 59hardware cacheAccess time: 50 nsSize: 10 bytescachemain storeAccess time: 500 nsSize: 10 6 bytesarchivebacking store: diskAccess time: 50 msSize: 10 9 byteslong-term store: magnetic tapeAccess time: 50 sSize: 10 12 bytesFigure 3.1 Four levels of storageare generally also on disk, and data in the hardware cache are in main store. Each leveltherefore acts as an archive for the level above it.Data that are currently accessed most frequently should be in the higher levels ofthe storage hierarchy. If we need to cache an item from an archive, access issignificantly slower. We call such a situation a cache miss. In contrast, a cache hit iswhen we find the data we need in a cache and need not turn to the associated archive.The effective size of store is the size of our tape library, shown in the figure as 10 12bytes. The effective access time depends on the percentage of accesses that result incache hits at each level. For the sake of calculation, let’s assume that the hit ratio is 95percent for all the levels in our picture. The effective access time is then0.95 . (50 ns) + 0.05 . 0.95 . (500 ns) + 0.05 . [0.95 . (50 ms)+0.05 . (50 s)] = 6.4 msAs the hit ratio increases, the effective access time decreases. With a hit ratio of 99 percentat all levels, the effective access time becomes 55 microseconds.The Hysteresis Principle applies to caching in the following way. Once data havebeen brought into a cache, which incurs some transfer expense, they should be left thereat least long enough to pay back that expense. We will encounter several examples ofthis application of the Hysteresis Principle in this chapter.1.3 Physical and virtual storeWe will repeatedly distinguish between physical and virtual store. Physical store is thehardware memory on the machine. Physical store usually starts at physical address zeroand continues to some large physical address. Microcomputers might have as few as 4Kor 8K bytes of main store; large mainframe computers often have 16M bytes. (A byte is

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

Saved successfully!

Ooh no, something went wrong!