Explanation of writepage/readpage in Linux swapping.
Hello there,
I need to understand how swapped out dirty pages are written to block devices (specifically swap partition in a hard drive). where is the code that actually does that?
To make myself even clearer: I need to fill in the gap in the the sequence of function calls when reading a page as a result of page fault handling...
do_page_fault -> __do_page_fault -> handle_mm_fault -> handle_pte_fault -> do_swap_page -> swapin_readahead -> read_swap_cache_async -> swap_readpage -> ???? -> (read from disk)
also, I need to know how the page is actually read from the disk ... for example, what is exactly read from the disk? is it only the page content? or is there also some other meta data that is read as well?
* misc info: arch = amd64, Linux version = 3.X, backing store for swap is a Linux Swap partition (do not care about files or anything else).
I would love also to know the sequence of function calls for writing a dirty page as well...in a similar fashion to the above. I have read the Linux documentation and I have a good idea how the memory is managed (active/inactive lists, kswapd..etc.).
My end goal is to add support to additional types of storage devices for swapping. For example, assume I would like to swap pages out to/swap in pages from other types of storage media.
Thanks.
|