|
|
Log in / Subscribe / Register

Straw man of user space unable to cope with errors

Straw man of user space unable to cope with errors

Posted Mar 12, 2015 10:01 UTC (Thu) by iq-0 (subscriber, #36655)
In reply to: Straw man of user space unable to cope with errors by tao
Parent article: Allowing small allocations to fail

Please no signal. Handling ENOMEM in multithreaded daemons is often a simple case of aborting or failing a single request (and thus also freeing up resources in the daemon itself, often releasing things like filedescriptors and the like as well). A signal would not confer any specificity about what caused it.

Sure normal programs should be allowed to be killed, but you'd pretty soon end up with a situation that all daemons would block this flag (since they can't really handle it gracefully). And on servers that effectively everything running (that really take up resources).

The only benefit would be if such a signal could be used to release all internal buffers, but that is often a problem that needs temporary resources and often needs to wait for other threads/processes to enter a quiescent state (and that possibly keep claiming resources until then). So that would only work before you have a problem.


to post comments

Straw man of user space unable to cope with errors

Posted Mar 12, 2015 10:32 UTC (Thu) by tao (subscriber, #17563) [Link] (1 responses)

SIGDANGER isn't intended or used to signal that the system is *out of memory*. SIGDANGER is used to convey to processes (that choose to register a handler for this) that memory is dangerously low.

Imagine how awesome it'd be to have memory hogging browsers (for instance) empty up cached memory? At the same time the signal could also be used by the UI to let the user know that something is a bit wrong (obviously such a feature should be used with a bit of caution -- getting to know that the system is low on memory at the same time Chrome frees up 4GB of cache would be rather pointless).

Straw man of user space unable to cope with errors

Posted Mar 12, 2015 19:42 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

See the memory pressure cgroup mechanism.


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