Page 255 - DCAP103_Principle of operating system
P. 255
Principles of Operating Systems
Notes must be made for each file-system block. To optimize system performance, file-system swap
space is allocated and de-allocated in swchunk-sized chunks. Swchunk is a configurable
operating system parameter; its default is 2048 KB (2 MB). Once a it is released for file
system use, unless it has been preallocated with swapon. If swapping to file-system swap
space, each chunk of swap space is a file in the file system swap directory, and has a name
constructed from the system name and the swaptab index (such as becky.6 for swaptab[6]
on a system named becky).
7.6.3 Swap Space Parameters
Several configurable parameters deal with swapping.
Table 7.1: Configurable Swap Space Parameters
Parameter Purpose
swchunk The number of DEV_BSIZE blocks in a unit of
swap space, by deault, 2 MB on all systems.
maxswapchunks Maximum number of swap chunks allowed
on a system.
swapmen_on Parameter allowing creation of more processes
than you have physical swap space for, by
using pseudo-swap.
7.6.4 Swap Space Global Variables
When the kernel is initialized, conf.c includes globals.h, which contains numerous characteristics
related to swap space, shown in the next table. The most important to swap space reservation
are swapspc_cnt, swapspc_max, swapmem_cnt, swapmem_max, and sys_mem.
Table 7.2: Swap Space Characteristics in Gobalsh
Element Meaning
bswlist head of free swap header list.
*pageoutbp pointer to swbuf header used by pageout when swapping.
ref_hand current reference hand used by pageout daemon.
maxmem page count of actual max memory per process.
physmem page count of physical memory on this CPU.
nswdev number of swap devices.
nswap pae count of size of swap space.
*fswdevt pointer to file system swap table.
*swaptab pointer to the table of swap chunks.
swapphys_buf pages of physical swap space to keep available.
swapphys_cnt pages of available physical swap space on disk.
Contd..
248 LOVELY PROFESSIONAL UNIVERSITY