Re: super root shell/mode/api

Andi Kleen
2009-05-17T15:02:56Z

Andrea <andrea256it@yahoo.it> writes:
>
> I know there is an OOM handling, but the only thing that
> happened was the hard disk light flashing for more or less 30 minutes
> and I was forced to press the reset button and my data was lost :(

One trick I found very useful to make OOM much less painful is to
make the swap partition small (not zero though).

The traditional suggestion of 2x RAM is far too large on modern
systems and since Linux is rather inefficient at swapping having
so much swap space just prolongs the death struggle.

With a smaller swap partition (not more than 100-200MB) the OOM killer kicks in
relatively quickly when something goes wrong and kills the offending process.

> I think it would be simply awesome to have a Linux Kernel mode
> similar to the c-64 cartridge concept.
>
> Maybe call it in honor to the c-64 'cartridge freeze mode' or so :)
>
> You hit a button combination and you enter in a Linux Kernel ncurses menu
> and/or shell and/or GUI, where you can for example:

You could do all that today by using a suitable kexec/kdump kernel setup with
sysrq-C.

The kdump kernel can do all that based on the image of the previous kernel.
Some of it is very easy (e.g. for disassemble just run "crash"), other
parts don't make sense (e.g. swap out processes -- the parent kernel
already did that)

Traditional distributions just dump the image, but there's no
principle reason it couldn't do more.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.