[OpenAFS-devel] How can the mem cache possibly not be able to allocate memory?
chas williams (contractor)
chas@cmf.nrl.navy.mil
Mon, 12 Apr 2004 13:54:14 -0400
In message <5C51DC2B8353AB4BA2CD04B34F2EE79C3EFE90@umr-umail1.umr.edu>,"Neuling
er, Nathan" writes:
>Interesting, I was reading that vmalloc should almost NEVER be used,
>since it forces the kernel to do page table operations that don't have
>to be done with kmalloc, and that the shortcoming of kmalloc is that it
>cannot do _large_ contiguous allocations. Supposedly vmalloc is not very
>smp friendly, and cannot be used in an interrupt as well.
this is why we use kmalloc() for smaller sizes. i know there is
a potential to page but its also a bad idea to lock down lots of
128k slab's. afs does this atleast twice, for the static inode
cache and the static dcache if you use kmalloc(). at one point
i had tracked down the large initializations. i can probably do
this again and try to fix these things the right way. typically
afs is only getting huge chunks of memory to be 'efficient' however
the kmem_cache() stuff in linux would probably be a better choice
for the inode table and the small/large memory allocators since
you could get 'better' alignment for the memory regions coming out
of these pools.