Page 258 - DCAP103_Principle of operating system
P. 258
Unit 7: Secondary Storage Structure
Notes
Table 7.3: Device Swap Table (struct swdevt)
Element Meaning
sw_dev Actual swap device, as defined by its major (upper 8 bits)
and minor (lower 24 bits) numbers.
sw_enable Enabled flag. Zero if device swap is disabled; one if enabled.
sw_start Offset into the swap area on disk, in kilobytes.
sw_nblksavail Size of swap area, in kilobytes.
sw_nblksenabled Number of blocks enabled for swap. Must be a multiple of
swchunk (2MB default).
sw_nfpgs Number of free swap pages on the device.
Updated whenever a page is used or freed.
sw_priority Priority of swap device (1-10).
sw_head, First and last swaptab[] entry associated
sw_tail with swap device.
sw_next Pointer to the next device swap entry (swdevt) at this priority;
implemented as a circular list used to update the pointer in
swdev_pri for round-robin use of all devices at a particular
priority.
The following table details the principle elements of the struct fswdevt.
Table 7.4: File System Swap Table (struct fswdevt)
Element Meaning
fsw_next Pointer to next file system swap (fswdevt entry) at this
priority; implemented as a circular list.
fsw_enable Enabled flag. Zero if file-system swap is disabled; one
if enabled.
fsw_nfpgs Number of free swap pages in this file system swap;
updated whenever a page is used or freed.
fsw_allocated Number of swchunks (2MB default) allocated on this
file-system swap.
fsw_min Minimum swchunks to be preallocated when the file-
system swap is enabled.
fsw_limit Maximum swchunks allowed on file system; unlimited
if set to zero.
fsw_reserve Minimum blocks (of size fsw_bsize) reserved for non-
swap use on this file system.
fsw_priority Priority of device (0-10). Priority can also be determined
by identifying swfs_pri [ ] linked list.
Contd...
LOVELY PROFESSIONAL UNIVERSITY 251