13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

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.

Physical representation 2156.1 AllocationWe will first examine the way that free space on the disk may be allocated. If we knowthe size of the file and wish to maximize clustering, we may allocate entire tracks orcylinders to the file. To make this allocation efficient, bit maps of free cylinders andtracks may be kept for each disk. These maps are kept on the disk, but a copy is alsokept in a main-store cache.A small example of cylinder and track bit maps is shown in Figure 6.10. Eachtrack is represented in both maps. The maps are arranged in the order of blocks on thedisk so that contiguous bits refer to contiguous tracks (that is, tracks on the same or adjacentcylinders). Figure 6.10 shades tracks that are in use. In this figure, there are eightcylinders, numbered 0 to 7. (Typical disk packs have 200.) Each cylinder has fourtracks.The following table governs which cylinders and tracks are marked in use.Allocation state Cylinder bit Track bitsWhole cylinder in use in use in useSome tracks in use in use in use (where appropriate)Completely free free in useSome file is using cylinder 4, so that cylinder is marked in use. All its tracks are markedin use in the track map. Two tracks of cylinder 1 and one track of cylinder 5 are also inuse at the moment. For this reason the cylinder map shows these entire cylinders as inuse. Cylinders 0, 2, 3, 6, and 7 are completely free, as shown by the cylinder map. Thetrack map shows their tracks to be in use so that they are not allocated unless absolutelynecessary.cylinder map0 1 2 3 4 5 6 7track mapFigure 6.10 Bit maps

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

Saved successfully!

Ooh no, something went wrong!