What are the events done by the Kernel after a process is being swapped out from the main memory?
When Kernel changes the process out of the primary memory, it performs the following:
Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, changes the region out of the major memory,
Kernel assigns the space for the swapping process in the swap device,
Kernel locks the other swapping process whereas the current swapping operation is going on,
The Kernel saves the changes address of the region in the region table.