Check out the new USENIX Web site. next up previous
Next: 3.5 Swapping In (rw_swap_page) Up: 3.4 Swapping Out (rw_swap_page) Previous: 3.4 Swapping Out (rw_swap_page)

Cleaning Mechanism

To clean the cache we need to send one or more buffers to the disk. This will allow the system to reuse them as an up-to-date copy of the data will be kept in the swap device. The intuitive idea of cleaning the cache consists of sending to the disk all buffers when no free space is left. As buffers do not usually get completely filled with compressed pages, we have modified the concept of full buffer as follows:

Full buffers
are those ones that have less free space than the average size of the last 100 compressed pages.

Using this new concept, whenever a page does not fit in the cache, all full buffers will be sent to the disk in a single operation where all of them are written contiguously on the disk. This will increase the performance of the write operations significantly.

Should the system need to perform a clean operation when there are no full buffers, the buffer with more data will be sent to disk.

As we do not want to wait until no free space is left on the cache to clean it, whenever it has a given percentage of its buffers full, the system writes them to the disk. This percentage can be adjusted to the needs of the system as will be seen in a later section. This operation is currently done in a synchronous way but we are working to make it asynchronous.

An important detail is the addition of a flag that tells whether there is a cleaning operation already running. If this flag is on, a second concurrent cleaning will not be done as only one is really needed.



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