|
Avoiding swap IO with mem_notifyAvoiding swap IO with mem_notifyPosted Feb 3, 2008 21:02 UTC (Sun) by oak (subscriber, #2786)In reply to: Avoiding swap IO with mem_notify by riel Parent article: Avoiding the OOM killer with mem_notify
The article talks also about embedded systems. Those use use flash which doesn't suffer from the seek problem like hard disks do. On embedded memory usage is much more of a problem though and kernel gets pretty slow too on devices without swap when memory gets really tight (all kernel does is page read-only pages from disk to memory and then discard them again until it finally does an OOM-kill). I thought the point of the patch is for user-space to be able to do the memory management in *manageable places* in code. As mentioned earlier, a lot of user-space code[1] doesn't handle memory allocation failures. And even if it's supposed to be, it can be hard to verify (test) that the failures are handled in *all* cases properly. If user-space can get a pre-notification of a low-memory situation, it can in suitable place in code free memory so that further allocations will succeed (with higher propability). That also allows doing somehing like what maemo does. If system gets notified about kernel low memory shortage, it kills processes which have notified it that they are in "background-killable" state (saved their UI state, able to restore it and not currently visible to user). I think it also notifies applications (currently) through D-BUS about low memory condition. Applications visible to user or otherwise non-background killable are then supposed to free their caches and/or disable features that could take a lot of additional memory. If the caches are from heap instead of memory mapped, it's less likely to help because of heap fragmentation and it requiring more work/time though. [1] Glib and anything built on top of it, like Gtk, assume that if process is still running, it got the memory, otherwise it's aborted.
(Log in to post comments)
|
Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.