Check out the new USENIX Web site. next up previous
Next: Cleaning Mechanism Up: 3 Prototype Description Previous: 3.3 Freeing a Page

3.4 Swapping Out (rw_swap_page)

Once the system wants to swap out a page, it compresses the page and tries to write it into the cache. Performing this operation, we might find that there is not enough free space to cache this new page. This means that all buffers are dirty (and have not been sent to the disk) and that all of them have less free space than the size of the compressed page. It is important to notice that the system will never split a compressed page among several buffers. When the system runs out of free space in the compressed cache, it performs a cleaning operation. Once it is done, at least one buffer will not be dirty and the system will be able to use it to put the new compressed page.

As we mentioned when describing the free operation, there are cases where a page could not be freed because there was a write operation still pending. If this is the last pending write operation and the page is marked as to be freed, the system will free the page after the write has been finished. The same steps as in the original free operation are taken.

Toni Cortes
Tue Apr 27 17:43:22 MET DST 1999