LWN.net Logo

POSIX_FADV_VOLATILE

POSIX_FADV_VOLATILE

Posted Nov 25, 2011 10:04 UTC (Fri) by civodul (subscriber, #58311)
Parent article: POSIX_FADV_VOLATILE

> In this scheme, applications would be able to open (and pass to poll()) a special file descriptor that would receive a message whenever the kernel finds itself short of memory. Applications would be expected to respond by freeing whatever memory they can do without.

Neal Walfield (GNU Hurd hacker) also explored adaptive application-driven memory management in a series of papers found at http://walfield.org/ .


(Log in to post comments)

POSIX_FADV_VOLATILE

Posted Nov 30, 2011 0:41 UTC (Wed) by vomlehn (subscriber, #45588) [Link]

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.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds