Subject: Re: overfilling mfs partitions larger than 600M causes kernel panics
To: Tim Kelly <hockey@dialectronics.com>
From: Hernani Marques Madeira <hernani@vecirex.net>
List: port-macppc
Date: 11/18/2004 18:18:01
On Thu, Nov 18, 2004 at 11:21:03AM -0500, Tim Kelly wrote:

> Hi Hernani,

Hi Tim.

> >  mkdir /mfs
> >  mount_mfs -s 600m ffs /mfs
> > UVM: pid 502 (mount_mfs), uid 0 killed: out of swap
> > killed
> > [/snip]
> > -> nothing mounted at /mfs
> 
> Seems reasonably behaved.

Yes, so far it's fine.

> > -> system hangs completely (without any output)
> 
> Any possibility this has dropped into ddb on a serial port?

Nope, it's a HP Jornada 720 that's bootet from Windows CE using the hpcboot.exe
utility and I've defined there it should not output to serial port.

I can see the whole dmesg output when booting up and also the output that's 
created when a pcmcia card gets attached or detached.

Also was
options DIAGNOSTIC
enabled in the kernfile when compiling the kernel.

> So it is possible that on your architecture this works only if the mfs
> is smaller than free. What is your swap size? Does the mount_mfs command
> work if the partition is smaller than swap, but the box crashes when it
> gets filled?

I have
no_swap=YES
in /etc/rc.conf.

However, I've the following line in /etc/fstab to enabling it when needed:
/data/swap none swap sw # "/data/" is a nfs partition and "swap" a file there

So, here it goes:

[snip]
 mount /data
 swapctl -A
swapctl: ading /data/swap as swap device at priority 0 # swap is 128M
 mount_mfs -s 16m ffs /mfs # 16m it's enough to crash it
 cp -R /usr/* /mfs
# ... a lot of messages that file system is full and there's no space left ...
 df -h /mfs 
Filesystem	Size	Used	Avail Capacity	Mounted on
mfs:619		15M	15M	-733K	105%	/mfs
[/snip]
-> system continues to work properly

I only can set it "unusable" under these circumstances if I create
a mfs partition being greater than the sum of the free RAM (15M) and the
swap space (128M):
[snip]
 mount_mfs -s 300m ffs /mfs
 cp -R /usr/* /mfs
cp: /mfs/X11R6/man/cat1/twm.0: Cannot allocate memory
cp: /mfs/X11R6/man/cat1/x11perf0: Cannot allocate memory
cp: /mfs/X11R6/man/cat1/xbiff.0: Cannot allocate memory
[/snip]
-> System does not hang completely (still pingable), but it's not really
   usable, only switching between the virtual terms is possible (without that
   it would accept any further input nor giving me some new output on these 
   terms). Logging in from outside is also not possible.

I've rebootet and testet again overfilling it without swap - and it has to be 
said that it never really completely crashes (it continues to be pingable) but 
it's even "more unusable" without it ;). Console switching as pressing the
power button are no longer possible without any swap space.

So, the kernel does never panic/crash on hpcarm - it's only without free bits
and can therefore not continue his work.

-- 
hernani