Re: Allocation of too much memory hangs system, kernel 2.2.*

Urban Widmark (urban@svenskatest.se)
Tue, 1 Jun 1999 11:07:39 +0200 (CEST)


On 1 Jun 1999, H. Peter Anvin wrote:

> Followup to: <p2t6759ipmq.fsf@safran.zrz.tu-berlin.de>
> By author: Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE>
> In newsgroup: linux.dev.kernel
> >
> > When the kernel runs out of vmem it starts to kill all runnable
> > processes. One of its first victims are apache, init (sic!) and
> > your shell. :)
> >
>
> Uh, no. init *can't* be killed.

It is perhaps not possible to kill init, but the kernel can stop init from
working (if it was actually killed or not ...). The effects I've seen is
that all processes that die end up as zombies and shutdown/reboot/halt
stop working.

I don't remember if I reported it or not, since I thought the "OOM"
problem was well known and left for future Linux versions.
(there were a lot of "OOM killer patches" that Andrea et al threw at each
other, around late 2.1.1xx :)

Some old(?) version of postgresql didn't like a sql statement of mine and
decided it needed lots of memory to optimize/parse it. That killed almost
everything on the machine (2.2.0 or 2.2.0-preX), I telnet'ed back and
there were zombies everywhere.
I didn't save the logfiles either, if init was killed the oom() should
have logged that.

And just to be sure I re-ran the same sql after rebooting and again random
processes were killed, but this time init was not killed/stopped/...

mm/memory.c does, on a task failing to 'put_dirty_page'
force_sig(SIGKILL, task);
which (I think) leads to
force_sig_info(sig, (void*)1L, p);
return send_sig_info(sig, info, t);

Then there is a permissions check with lots of && expressions, where
info == 1L
This part is then not true, so the operation is allowed
(!info || ((unsigned long)info != 1 && SI_FROMUSER(info))

And then I'm lost ... I can't find where the kernel is stopped from
killing init.

I suppose I should provide better debugging info by repeatedly killing a
machine (with a recent 2.2 kernel) until I manage to hit init, if that is
possible.

/Urban

-
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/