What's the difference between kmem_arena and kernel_arena?

Konstantin Belousov kostikbel at gmail.com
Sun Sep 21 20:04:07 UTC 2014


On Sat, Sep 20, 2014 at 03:07:30PM +0800, btw at mail.ustc.edu.cn wrote:
> Hi All,
> 
> There are two similar variables declared in vm/vm_kern.h, they are kernel_arena
> and kmem_arena. Both of them are used in kmem_malloc():
> 
>         rv = kmem_back((vmem == kmem_arena) ? kmem_object : kernel_object,
> 
> I'm wondering what's the difference between them. Why both of them are needed?
> I have done a lot of searching, but I still can not find an answer.

Look at their usage.

kmem_arena is used for the kernel malloc() and page-sized uma allocations.
kernel_arena is used by miscellaneous other kernel needs, e.g. for
kernel stacks of threads, as the backing for kva_alloc() etc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140921/5ef39750/attachment.sig>


More information about the freebsd-hackers mailing list