Subject: Re: auich driver support of Intel 82801DB AC97 Audio
To: Frederick Bruckman <fredb@immanent.net>
From: Alicia da Conceicao <alicia@engine.ca>
List: port-i386
Date: 12/17/2003 11:36:10
> It actually looks like the kernel memory allocator is failing to
> allocate a chunk of kernel memory. You'll be able to see clearly
> if that's the case, if you build a kernel with "options KMEMSTATS".
> "vmstat -m" will have entries in the "fail" column. If that bears out,
> then try building a kernel with "options NKMEMPAGES" somewhat higher
> than the default value, which can be viewed with "sysctl vm.nkmempages".
> Adjust as needed.
> It's not quite that you really run out of memory; it's more that the
> pool gets fragmented, even early in the boot sequence. For instance,
> I have a 486 with 64MB that's doing RAID. At some point in the past
> year, its NKMEMPAGES had to be bumped to 6000 in order for the SMC
> ethernet card to work. Interestingly 1) "vmstat -m" never showed it
> coming close to using up all the available kernel memory, and 2) the
> actual usage went down, after increasing NKMEMPAGES a little. I take
> all that to mean that the available memory was fragmented.

Hi Frederick:

Thanks again for you suggestion.  Unfortunately I still get the same
codec failure error on the auich audio driver when I increased the
minimum NKMEMPAGES to 65536.  (Keep in mind that my sub-notebook has
512MB of RAM, minus 16MB for video.)

With the kernel changes you suggested, I get the following:

	> sysctl vm.nkmempages
	vm.nkmempages = 65536

Before it was set to 16384, so I doubled it.  I don't know if it
helps, but at the end of this message, I have attached the output
from "vmstat -m" below.

Thanks again for your suggestion.  Please do not hesitate to offer
any additional suggestions.

Thanks in advance.
Alicia.

==== output from "vmstat -m" ========================================
vmstat: kptr ffffffff: pool allocatior trashed: kvm_read: Bad address
Memory statistics by bucket size
    Size   In Use   Free   Requests  HighWater  Couldfree
      16      394    118       3467    1280          0
      32     3049     23       4955     640          0
      64     2037     75       4393     320          0
     128      873     23       1538     160          0
     256      342     10        676      80          0
     512       59      5         74      40          0
    1024      218      6        358      20          0
    2048       47      5        159      10          0
    4096       19      3         23       5          0
    8192        6      0          7       5          0
   16384        5      0          5       5          0
   32768        2      0          2       5          0
   65536        8      0          8       5          0
  131072        1      0          1       5          0
  262144        1      0          1       5          0

Memory usage type by bucket size
    Size  Type(s)
      16  acpi, USB, VM swap, UVM aobj, UVM amap, namecache, soname, sysctldata,
	  proc, routetbl, temp, pcb, devbuf, exec, kernfs mount, NETSMBDEV
      32  acpi, USB, AGP, VM swap, UVM amap, ether_multi, ifaddr, vnodes,
	  soname, routetbl, temp, pcb, devbuf
      64  acpi, USB, UVM amap, lockf, prop, session, routetbl, pcb, DMA map,
	  devbuf, exec
     128  acpi, USB device, USB, AGP, VM swap, UVM amap, ifaddr, soname, ttys,
	  prop, sysctlnode, cred, routetbl, temp, devbuf, key mgmt
     256  acpi, USB device, USB, VM map, UVM amap, ifaddr, vnodes, subproc,
	  proc, routetbl, temp, pcb, DMA map, devbuf, exec, kevent, newblk,
	  NFS daemon
     512  USB device, UVM amap, mount, proc, UFS mount, pcb, devbuf, ioctlops,
	  NTFS mount, NFS srvsock, MSDOSFS mount, crypto
    1024  acpi, UVM aobj, UVM amap, ttys, temp, devbuf, exec, kevent,
	  NQNFS Lease, key mgmt
    2048  UVM amap, ifaddr, sysctlnode, in_multi, UFS mount, temp, devbuf, exec
    4096  UVM amap, sysctlnode, temp, devbuf
    8192  UVM amap, namecache, sysctlnode, devbuf
   16384  sysctlnode, UFS mount, pagedep
   32768  namecache, MSDOSFS mount
   65536  namecache, UFS mount, temp, UFS quota, inodedep, NTFS nthash,
	  NFS node, ISOFS mount
  131072  devbuf
  262144  MSDOSFS fat

Memory statistics by type                        Type  Kern
         Type  InUse MemUse HighUse  Limit Requests Limit Limit Size(s)
          acpi  3560   228K    230K157287K     6191    0     0  16,32,64,128,256,1024
    USB device    16     7K      7K157287K       16    0     0  128,256,512
           USB    54     5K      5K157287K       54    0     0  16,32,64,128,256
           AGP     2     1K      1K157287K        2    0     0  32,128
       VM swap     5     1K      1K157287K        5    0     0  16,32,128
        VM map     4     1K      1K157287K        4    0     0  256
      UVM aobj     2     2K      2K157287K        2    0     0  16,1024
      UVM amap   313    45K     47K157287K     4866    0     0  16,32,64,128,256,512,1024,2048,4096,8192
   ether_multi     1     1K      1K157287K        1    0     0  32
        ifaddr    17     4K      4K157287K       17    0     0  32,128,256,2048
         mount     4     2K      2K157287K        9    0     0  512
        vnodes  1788    64K     64K157287K     1810    0     0  32,256
         lockf     2     1K      1K157287K      282    0     0  64
     namecache     4   105K    105K157287K        4    0     0  16,8192,32768,65536
        soname     4     1K      1K157287K        9    0     0  16,32,128
          ttys   336   218K    218K157287K      336    0     0  128,1024
          prop     2     1K      1K157287K        2    0     0  64,128
    sysctldata     0     0K      1K157287K        1    0     0  16
    sysctlnode    42    99K     99K157287K       48    0     0  128,2048,4096,8192,16384
          cred     4     1K      1K157287K      135    0     0  128
       subproc     1     1K      1K157287K        2    0     0  256
       session    12     1K      1K157287K       13    0     0  64
          proc     3     1K      2K157287K        4    0     0  16,256,512
      in_multi     1     2K      2K157287K        1    0     0  2048
     UFS mount     9   115K    115K157287K        9    0     0  512,2048,16384,65536
      routetbl    18     2K      2K157287K       25    0     0  16,32,64,128,256
          temp    10    62K     67K157287K      642    0     0  16,32,128,256,1024,2048,4096,65536
           pcb    18     4K      4K157287K       24    0     0  16,32,64,256,512
       DMA map   432    76K     76K157287K      432    0     0  64,256
        devbuf   365   204K    204K157287K      469    0     0  16,32,64,128,256,512,1024,2048,4096,8192,131072
          exec     6     1K     10K157287K      217    0     0  16,64,256,1024,2048
        kevent     2     2K      2K157287K        2    0     0  256,1024
      ioctlops     0     0K      1K157287K        2    0     0  512
     UFS quota     1    64K     64K157287K        1    0     0  65536
        newblk     1     1K      1K157287K        1    0     0  256
      inodedep     1    64K     64K157287K        1    0     0  65536
       pagedep     1    16K     16K157287K        1    0     0  16384
    NTFS mount     1     1K      1K157287K        1    0     0  512
   NTFS nthash     1    64K     64K157287K        1    0     0  65536
   NFS srvsock     1     1K      1K157287K        1    0     0  512
    NFS daemon     1     1K      1K157287K        1    0     0  256
   NQNFS Lease     1     1K      1K157287K        1    0     0  1024
      NFS node     1    64K     64K157287K        1    0     0  65536
   MSDOSFS fat     1   144K    144K157287K        1    0     0  262144
 MSDOSFS mount     2    33K     33K157287K        3    0     0  512,32768
  kernfs mount     1     1K      1K157287K        1    0     0  16
   ISOFS mount     1    64K     64K157287K        1    0     0  65536
     NETSMBDEV     1     1K      1K157287K        1    0     0  16
      key mgmt     7     5K      5K157287K       16    0     0  128,1024
        crypto     1     1K      1K157287K        1    0     0  512

Memory totals:  In Use    Free    Requests
                 1761K     44K       15670
=====================================================================