8 Jun 2004 17:12
Re: why swap at all?
Ray Bryant <raybry <at> sgi.com>
2004-06-08 15:12:50 GMT
2004-06-08 15:12:50 GMT
Buddy Lumpkin wrote: > <snip> One method would be to keep the > pagecache on it's own list, and move pages to the head of the list any time > they are modified or referenced, and reclaim from the tail. > > All pages on this list can be considered as "free memory", because any new > memory requests would just cause pages to be evicted from the tail of the > list. > We have code running on Altix that does exactly this. (Please note, however, that this is for our version of Linux 2.4.21 -- Yeah, its old, but that is what the product runs at the moment -- we are in the process of switching over to Linux 2.6 when all of this will have to be re-evaluated.) The changes are in three parts: (1) We added a new page list, the reclaim list. Pages are put onto the reclaim list when they are inserted into the page cache. They are removed from the list when they are marked dirty (buffers from the page go on to the LRU dirty list) or when the pages are mmap'd into an address space, since in either of these situations, the pages are not reclaimable. (This list is per node in our NUMA system.) (2) We added code in __alloc_pages() so that if the local node allocation is going to fail (remember that Altix is a NUMA machine), we call out to a routine to scan the reclaim list on that node and to release enough clean buffer cache pages to make the local allocation succeed (plus a few pages, for efficiency). If this doesn't work, we most likely end up spilling the allocation over(Continue reading)
RSS Feed