Posted Nov 30, 2011 0:41 UTC (Wed) by vomlehn
In reply to: POSIX_FADV_VOLATILE
Parent article: POSIX_FADV_VOLATILE
Though the idea of process notifications when the kernel runs low on free pages is a common one, this approach still gives me the willies. Two issues give me pause:
In the general case, processes freeing memory may temporarily use more memory (say, by swapping pages in or allocating file buffers for output) in order to free memory. Marking pages for the kernel to grab without running the process that has them seems much less likely to dead- or livelock.
- The reason the kernel is running out of memory may very be due to to a new process grabbing memory as it starts up. Such a process may grab memory a lot faster the clean up process happens.
Rik Van Riel's issue about multipage objects is valid, but having the kernel grab all associated pages addresses that and, I expect, does so in a way that matches the way multi-page objects are likely to be used, so I think this is a moot point.
Looking things from a higher level, though, the two approaches are not exclusive and each has cases where it can do things the other can't.
to post comments)