[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

[LI] Swap file system.



hi,

	this is regarding the swap filesystem. soory i didn't have a copy
of the previous thread. The question is what file system the swap uses ?

	Swap in fact doesn't have any filesystem as such.

	The first 4kb (4096 bytes) of the swap space is used to maintain 
	information about the swap.Of this the last 10 bytes have the 
	signature "SWAP-SPACE" . The remaining 4086 bytes is used as a 
	bitmap.The swap blocks are considered as 4k blocks.So if there 
	is a 32 mb swap, the bits in the bitmap indicate where the 
	corresponding blocks are there.This bitmap information is read
	from disk only once, when the system call swapon is called by the
	init process and the kernel set up corrresponding data structures 
	which are used till the swap is removed by calling the system 
	call 'swapoff'.
	The main parameters that are mainitained in the kernel data	
	structure are a bitmap and an char array.Bits are set in the 
	bitmap to indicate a read or write is taking place to a swap
	block corresponding to the bit set. The char array corresponding
	a swap block contains the count of many process have their pages
	swapped out to this block. When the count is zero, the
	correspodning swap block is free.

	- sharma

 
	 

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.