What's the difference between kmem_arena and kernel_arena?

btw at mail.ustc.edu.cn btw at mail.ustc.edu.cn
Mon Sep 22 03:19:11 UTC 2014


I got it! Thank you so much! ;-)

-twb

> -----Original E-mail-----
> From: "Konstantin Belousov" <kostikbel at gmail.com>
> Sent Time: 2014-9-22 4:04:01
> To: btw at mail.ustc.edu.cn
> Cc: freebsd-hackers at freebsd.org
> Subject: Re: What's the difference between kmem_arena and kernel_arena?
> 
> 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.



More information about the freebsd-hackers mailing list