Tuesday, May 5, 2009

Handling Swap-Page Faults

read_swap_cache_async locks the page and block layer unlocks when it finishes the reading.

read ahead pages are kept in swap cache.

swap area is on disk. swap cache is in RAM.

the first part of read_swap_cache_async reserves RAM pages for the swap-in and puts them neatly in the swap cache space. then in the 2nd part, swap_readpage reads the page from swap area (disk/ram) to the swap cache.

swap_readpage initiates the data transfer by { get_swap_bio: req gen, submit_bio: req send }

swap cache is just a radix tree.

swap entry in the swap area index is kept in page private field.

swapin_readahead just an additional layer around read_swap_cache_async ... tune it by using /proc/sys/vm/page-cluster

No comments:

Post a Comment