Re: kmem leak in tmpmfs?



On Fri, 2006-05-26 at 13:15 +0200, Fabian Keil wrote:
Iasen Kostov <tbyte@xxxxxxxx> wrote:

On Thu, 2006-05-25 at 16:54 -0400, Kris Kennaway wrote:
On Thu, May 25, 2006 at 06:01:30PM +0200, Arno J. Klaassen wrote:

I get a very easy to reproduce panic on 6.1-STABLE :

/etc/periodic/weekly/310.locate panics with

panic: kmem_malloc(4096): kmem_map too small: 335544320 total
allocated

It looks like you are using a malloc-backed md and you do not have
enough RAM to handle the size. Perhaps tmpmfs does not use swap
backing, as it is supposed to?

First of all if there is not enough kmem (not just plain ram
I think) kernel should not allow disk creation in first place, second
- I think (although there could be some ... reason for that) it's
stupid way to say "I don't have more kmem" by panicing :). Better way
will be just to fail disk operation of that FS with "Disk is full" or
something like that. At home I tried to raise kmem like that:
"vm.kmem_size_max="1073741824" (I got 2G of RAM)
(setting vm.kmem_size directly panices kernel at boot if I remember
correctly).

but for my surprise kernel panices at exact same allocated md disk
space with the same panic as the original poster's. Is it possible
that I should rise KVA_PAGES too ? And I don't think its documented
anywhere (of course I've tried googling and it's always possible that
I've missed something :). All this was on FreeBSD 6.0.

man mdconfig mentions the problem:

malloc Storage for this type of memory disk is allocated with
malloc(9). This limits the size to the malloc bucket
limit in the kernel. If the -o reserve option is not
set, creating and filling a large malloc-backed memory
disk is a very easy way to panic a system.

Use a swap backed disk and the problem will disappear.
I ment KVA_PAGES (If it is the limit). But may be "malloc bucket
limit" (which I don't realy understand what it means) has something to
do with it ? But whatever is the cause I think it no good practice to
leave such easy ways to panic the kernel unsecured/pached/fixed. And I
wander why even when I set kmem_size_max to 1G kernel still panices
around 350MB allocated md space ? I mean what is the real issue there ?

Regards.


_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Problem booting RAID1/mdadm system when one disk is unplugged
    ... My System has 2x120GB IDE disks with the an up-to-date Sarge install, running kernel 2.6.8-3 and configured for mirroring. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ... first disk BIOS presents, and partition number 6 on that disk. ... You always want to RAID1 the swap as well. ...
    (Debian-User)
  • Re: kmem leak in tmpmfs?
    ... I think) kernel should not allow disk creation in first place, ... This limits the size to the malloc bucket ...
    (freebsd-stable)
  • Re: Breaking the 137GB barrier (LBA48)
    ... my Fedora Core 2 installation is not able to see more ... How is your BIOS set for this disk? ... after the kernel has been loaded at which time the kernel should see ... For swap there is no special need to be too generous ... ...
    (Fedora)
  • Re: Cant boot 2.6.20, get /dev/root error.
    ... Kernel panic - not syncing: ... So, I dont understand, - /dev/sda5 is my swap device, ... suspend to disk. ... If the swap partition has the flags that show you ...
    (Fedora)
  • Re: Cant boot 2.6.20, get /dev/root error.
    ... Kernel panic - not syncing: ... So, I dont understand, - /dev/sda5 is my swap device, ... suspend to disk. ... If the swap partition has the flags that show you ...
    (Fedora)