Subject: kern/34667: NTFS uses to much kernel memory
To: None <,,>
From: Simon Burge <>
List: netbsd-bugs
Date: 09/30/2006 04:30:00
>Number:         34667
>Category:       kern
>Synopsis:       NTFS uses to much kernel memory
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 30 04:30:00 +0000 2006
>Originator:     Simon Burge
>Release:        NetBSD 4.99.2 from September 24.
NetBSD 4.99.2 NetBSD 4.99.2 (EUCLID2) #14: Sun Sep 24 13:53:40 EST 2006 i386
Architecture: i386
Machine: i386

        Every couple of nights when /etc/daily runs it's find, I get a

		panic: malloc: out of space in kmem_map

        panic.  A "vmstat -m" on the kernel core shows that NTFS is
        using about 119MB of the 128MB allocated for kmem_map:

Memory statistics by type                           Type  Kern
         Type  InUse MemUse HighUse  Limit  Requests Limit Limit Size(s)
     NTFS vrun  7056   131K    131K 78644K      7060    0     0  16,32,64,128,256,512
      NTFS dir 12496 49984K  49984K 78644K     12496    0     0  4096
 NTFS res data 44690  7836K   7836K 78644K     44695    0     0  16,64,128,256,512,1024,131072
    NTFS vattr 48217 24109K  24109K 78644K     48224    0     0  512
    NTFS fnode 81032 20258K  20258K 78644K     81034    0     0  256
   NTFS ntnode 81032 20258K  20258K 78644K     81034    0     0  256


        Mount a NTFS filesystem with about 127000 files and run find(1).
        Note that the find from /etc/daily doesn't cause the kernel to
        run out of memory every night, seems to be about every third


        Not sure.  Converting NTFS to use pools should at least relieve
        some pressure on kmem_map.  The "NTFS dir" allocations (the
        largest memory user) though are not fixed size, so won't convert
        to pools easily.