Re: Some questions about linux kernel.

From: Rik van Riel (riel@conectiva.com.br)
Date: Sun Mar 12 2000 - 09:54:08 EST


On Sun, 12 Mar 2000, James Sutherland wrote:
> On Sun, 12 Mar 2000, Rik van Riel wrote:
> > On Sun, 12 Mar 2000, Peter Zaitsev wrote:
> > > > It's not so. SOME solution is easy enough. But is it right solution ?
> > > > This is unclear. To many peoples ANY solution where ANY process can
> > > > be killed is "not right" -- theonly proper solution will be one where
> > > > you'll get NULL from malloc when there are not enough memory.
> > >
> > > HM. Does not malloc return NULL if it's out of memory now ?
> >
> > Indeed. This has the interesting property of killing
> > (usually) klogd and syslogd and up to about a dozen
> > critical system programs before (maybe) catching the
> > hog.
> >
> > When malloc() returns NULL, processes will die. We'd
> > better kill the memory hog before something critical
> > dies...
>
> In other words, we should try to detect malloc() ABOUT to return
> NULL, and use that as a cue to find and kill the process using
> the most VM, then retry the malloc() call? Sounds like the best
> solution, IMHO.

This is almost exactly what my patch does (except
that it's all in-kernel)...

Rik

--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

http://www.conectiva.com/ http://www.surriel.com/

- 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 : Wed Mar 15 2000 - 21:00:21 EST