Welcome to the Linux Foundation Forum!

Restricts access to some part of memory

Linux kernel support allocating memory, which could been released in case of insufficient memory. Process can recreate this memory content, when needed.

My idea address situation, where there's too small amount of memory. Instead killing process, we could reserve memory for use in above case - to be free, when needed. Linux kernel will reserve some memory amount to be allocated in described way. But wait - what this give us? When we reserve memory for this purpose, this gives us nothing! The trick is in special posix capabilities, allowing process to use described memory region in normal way and priority to allocating memory in such region.

X will have this capability and process monitor will have this capability. When system hangs, because no memory, user will start process monitor, memory will be released for process monitor and in case, when process monitor (and other process with this capability) requires smaller memory amount than reserved region, user select process to kill.

Of course - that's not be magical solution - programs must be adopted to allocating memory, which could been released by kernel, when possible.

Comments

  • I have another, but similar idea - swap memory allocated as freeable into GPU RAM. I know Linux on Sony Playstation is able to use GPU memory. We shouldn't use this memory as swap in all scenarios, because someone might would like to play games, but if we swap there only memory segments, where are freeable blocks (blocks, which app could recreate), then we make Linux better.

Categories

Upcoming Training