From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,13007e6f500d17dd X-Google-Attributes: gidf8c9b,public X-Google-Thread: fee84,13007e6f500d17dd X-Google-Attributes: gidfee84,public X-Google-Thread: fc89c,13007e6f500d17dd X-Google-Attributes: gidfc89c,public X-Google-Thread: 10650a,13007e6f500d17dd X-Google-Attributes: gid10650a,public From: steffen@manta.latrade.com (Steffen Ullrich) Subject: Re: out of swap -> killing inetd Date: 1996/07/12 Message-ID: <4s5n9v$bt9@xensei3.xensei.com>#1/1 X-Deja-AN: 167994622 references: <4rr9md$gsc@xensei3.xensei.com> <4rteld$2tb@route1.france3.fr> content-type: text/plain; charset=us-ascii organization: The Xensei Corporation mime-version: 1.0 newsgroups: comp.unix.internals,comp.unix.osf.osf1,comp.unix.questions,comp.unix.programmer In article <4rtqbf$dp9@news.iastate.edu>, john@iastate.edu (John Hascall) writes: > Boyd Roberts wrote: > }steffen@latrade.com says... > }>A while ago I run a really big process (user process - no root!) on an > }>DEC UNIX 3.2C machine with 64MByte so that the machine run out of swap > }>space. Instead of killing the process which caused this problem it > }>randomly killed other processes - among them the inetd. > > }Process killing based on memory/swap resource problems was always a > }bad idea. It's next to impossible to determine what to kill and a worst > }case scenario is that everything is killed before the offending process is. > > }At least with Digital UNIX you can choose a swap policy to be eager or lazy. > }I'd make it eager and then the chance of this scenario is lessened. > > Well, they give you the choice between two not real pleasent choices. > a) lazy mode = take your chances, but save swap space > b) eager mode = offending process gets it, but need LOTS of swap > > What would be nice (I think) is: > 1) per-process control of lazy/eager > 2) ability to mark a process non-swappable > 3) a wait/die per-process flag for what to do when no swap available. > all of which can be set external to a process (e.g., no need to > have source/recompile). For example: > > # swapctl -noswap `cat /etc/inetd.pid` > # swapctl -lazy 34 47 59 I think the problem is a bit harder to solve. First it makes IMO no sense to force the system not to swap inetd. In this way we loose some of the RAM, even if its nearly never used by the process. Then we still can get the situation that all RAM+swap is used but somebody needs to remote login. In this case inetd would maybe need to allocate more memory which it could not because there is no more memory available. And even if there is a tiny piece of memory available inetd needs to fork+exec the in.rlogind to actually respond to the request on the port. So we must guarantee that not only inetd gets enough mem but also some other processes which gets spawned by inetd. That means that we need to assign memory priorities by process image and not by PID and that other processes with less priority needs to be killed if necessary. And if the processes with the highest mem priority cannot get more memory, e.g. if all memory is used by this high priority processes than we know that something went completly wrong and the system better reboots itself immediatly. And again, I don't think that this problem has anything to do with the swap mode you use.