Re: Re: Ideas for memory management hackers. ( "importance levels" )

Albert D. Cahalan (acahalan@cs.uml.edu)
Tue, 18 Nov 1997 18:49:45 -0500 (EST)


Steffen Ullrich writes:

> what I really like to see is something like various "importance
> levels" for processes. imagine the following: An remote system
> behaves really bad and you want to have a look at it. You try to
> telnet to the machine but what happens there is that inetd tries
> to spwan in.telnetd. Because the system is already heavily used
> it cant get the memory/swap space needed to start in.telnetd on
> this system. A nice thing in this case would be that the system
> could be configured to consider in.telnetd as a very important
> application and do everything to start it, even if it needs to
> kill some less important processes.

I see a use for the sticky bit.

> I had similar problems several times on OSF/1 (DEC UNIX) where
> I run a big application on a remote machine. I guess the following
> happened: The application took more and more memory but now another
> process got scheduled by the system so the system needed to move
> some pages of my app to the swap space. unfortunatly there wasn't
> any more space so OSF/1 too his strategy to get some free space -
> it killed the processes which were not used for the longest time.
> unfortunatly in this cases this was inetd :(

Good move! :-) Linux systems _always_ kill the X server first.
With PC video hardware, that is a great way for the kernel to get
rid of those annoying users. Many video cards can require a full
power down to reset.

> There are two modes of allocating swap space in OSF/1.
> one is the deferred mode which allocates a page in the swap
> space once a page needs to be swapped out, the other more
> conservative mode allocates a space in the swap area for
> each page used by the system. The first mode is a bit faster
> and uses less memory but has the problem above. The machine
> used the deferred mode which is I think similar to the mode linux
> uses - otherwise you couldn't run a system w/o swap space setup.

Mixing the policies requires the ability to kill a process that
is not current. (perhaps Linux can?) In such a system, reserved
swap should be restricted to root. I guess all 8 MB of stack
would need to be reserved.

That policy should be _forced_ on any process with IO permission.
If swap can not be reserved, then refuse IO permission. This
would go a long way towards better system stability.