Re: On the issue of low memory situations

From: Linda Walsh (law@sgi.com)
Date: Sat Mar 18 2000 - 12:28:09 EST


Nicholas Vinen wrote:
> Well, you could use SA_RESETHAND with sigaction to specify that
> behaviour but yes, you'd expect that you would almost always want that.

---
	Not to belabor the point, but not "almost", but "always".
You wouldn't want it to be under user control -- since
you could end up with non-deterministic or deadlock behavior.  This is
one signal that should always reset the action back to 'non-caught'.	

> However I do think that such a signal should be triggered before memory is > TOTALLY exhaused (perhaps if you trigger the allocation of the 5th last > page in existance or something). This way you have enough pages to do your > cleanup at least. --- Dunno if those stats are kept around -- not to mention in a SMP environment, it wouldn't be that useful -- lez say I have a 16 CPU sys. My hog processu goes malloc and somehow I determine there are only 5 pages left. By the time I get that information back to the hog process (it may get unscheduled), that 5 page figure could have changed N-times, making it not so useful. One could argue, however, that you could hold 5% of memory in reserve for UID=0 processes, but what does that mean if we are running in a capability-based system (where UID=0 means squat) -- I'd suggest punting that issue to the next rev and deal with the most pressing matter (I'm outa memory: HELP) more gracefully. I guess we could add a CAP_USE_LIMITED_MEMORY. When there is x% reserved in an ext2 filesystem for 'root', which capability does it use? Is there already a generic CAP_USE_LIMITED_RESOURCES?

> OK, now the only issue is who is going to write this. I'm kinda > busy this weekend ;) Shouldn't be too hard though. Anyone? --- Sigh. ;~) -l -- Linda A Walsh | Trust Technology, Core Linux, SGI law@sgi.com | Voice: (650) 933-5338

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:24 EST