wiredtiger/wiredtiger — pull request #472 by keithbostic (2013-03-04 18:41:28+00:00)
Title: posix_fadvise, sync_file_range

Replace os_cache_max configuration and behavior with calls to: (1) discard any page read from the system cache, (2) immediately schedule all page writes to the disk, and (3) periodically discard any pages written from the system cache. In all three cases, nothing happens if O_DIRECT is configured.

Michael, I've verified these changes individually work to limit WT's effect on the system cache.

I have not verified there's no performance impact (I can't imagine they won't be faster than O_DIRECT, but if O_DIRECT is not configured, I've added what I believe is a relatively cheap system call per read and write, plus a relatively expensive system call per 1,000 writes).

I'd like talk this over with you, specifically if we need to verify the performance impact and what that might look like.

Also, I've hard-coded the cache clean up at every 1,000 writes, which I don't really like, but I also can't think of any way to quantify it, if we were to make it tunable.